The document contains two Python code snippets with errors. The first asks the user for a temperature and prints a message depending on whether it is above or below 25. The second asks for a time and prints a different greeting depending on the time of day. Both code snippets ask the user to fix the errors and provide a screenshot of the corrected code.
Download as PPTX, PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
68 views
Debugging - Python
The document contains two Python code snippets with errors. The first asks the user for a temperature and prints a message depending on whether it is above or below 25. The second asks for a time and prints a different greeting depending on the time of day. Both code snippets ask the user to fix the errors and provide a screenshot of the corrected code.
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 2
Task 1
temp = float(input("What is the temperature? "))
if temp > 25 print("Wear shorts. ") else: print(Wear trousers.) Now fix the errors: Place a screenshot of your fixed code here. Type the code below into Python and press enter: Task 2 time = inf(input("What is the time? "))
if time < 10: print("Good morning) elif time-12: print("Soon time for lunch) elit time<18: print("Good day) elif time<22: print ("Good evening) else: print ("Good night) Now fix the errors: Place a screenshot of your fixed code here: Type the code below into Python and press enter: