Premium Only Content

Functions and User Input |Section 3|Celestial Warrior
The next lecture will be an exercise and there will be more exercises as you progress through the course.
The exercises are difficult and sometimes tricky and I don't expect students to solve them all. Most students actually fail to solve the exercisesunless they are already familiar with Python.
The whole point of exercises is to force you to think about how to solve a problem independently. The next lecture following each exercise contains the solution where you can compare your approach.
Create a functionthat converts Celsius degrees toFahrenheit. The formula to convert Celsius to Fahrenheit isF= C 9/5 + 32.
In the previous exercises you used the interactive Udemy interface to write your code.For this exercise, please use your computertools (Python, editor, terminal,etc.). This will help you get used with Python in a real environment.
Once you are done check your solution against my solution which islocatedin the next lecture. Don't worry if your solution is not exactly the same as mine. As far as the solutions generate the same output, your solution is most likely correct.
def cel_to_fahr(c):
f = c * 9/5 + 32
return f
And here is an example of calling the function:
print(cel_to_fahr(10))
That would return 50.0 which means 10 degreeCelsius is equal to 50 degreeFahrenheit.
Create a function that takes any string as argument and returns the length of that string.
def string_length(mystring):
return len(mystring)
And here's an example of calling the function:
print(string_length("Hello"))
That would return 5.
-
LIVE
Caleb Hammer
2 hours agoThe First LGBT Divorce On Financial Audit
112 watching -
LIVE
Badlands Media
1 hour agoBadlands Daily: September 3, 2025 (#2)
3,315 watching -
LIVE
Jim Jordan
1 hour agoEurope’s Threat to American Speech and Innovation
492 watching -
LIVE
The State of Freedom
5 hours agoFLF: #16 Delivering the Truth Comes at a Cost w/ Joe Hoft
16 watching -
31:01
Rethinking the Dollar
1 hour agoWe're In A NEW Monetary Reality! Xi & Putin Knows How This ENDS | Morning Check-In: Let's Talk...
5.97K -
LIVE
House Committee on Energy and Commerce
2 hours agoExamining Opportunities to Advance American Health Care through the Use of AI Technologies
19 watching -
1:04:12
Crypto Power Hour
3 hours ago $0.19 earnedSmart Contracts & Fintech 101
4.94K5 -
45:55
Randi Hipper
1 hour agoBITCOIN HOLDS CRITICAL LEVEL! NEXT MOVE DETERMINES EVERYTHING
5.38K -
3:10:58
The Pete Santilli Show
12 hours agoMORNING STREAM Wednesday September 3, 2025 ▐ THE PETE SANTILLI SHOW & SANTILLI REPORT 9/2
9.7K1 -
1:41:59
Dear America
3 hours agoNational Guard To Chicago!!! 33k Epstein Files Released!! + Did Trump Threaten China?!
98.9K65