This code I wrote isn't running. I need help to fix the bug | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

This code I wrote isn't running. I need help to fix the bug

while True: name_of_month = input('Enter the of month to see the number of days in it or type quit to end the program: \n').capitalize() if name_of_month == 'quit': print('End of Program') elif (name_of_month == 'September' or name_of_month == 'April' or name_of_month == 'June' or name_of_month == 'November'): print(name_of_month, 'has 30days!') elif name_of_month == 'February': print(name_of_month, 'has 28 days and 29 days each leap year') elif name_of_month == 'January' or name_of_month == 'March' or name_of_month =='May' or name_of_month == 'July'or name_of_month == 'August' or name_of_month == 'October' or name_of_month == 'December': print(name_of_month,'has 31 days') break

13th Feb 2020, 11:42 AM
Samuel Addo
Samuel Addo - avatar
3 Answers
+ 1
Seems to be working. What is the problem? Edit. OK maybe because in SL you cannot have inputs during code running. All inputs must be delivered at the begining.
13th Feb 2020, 11:49 AM
Mihai Apostol
Mihai Apostol - avatar
+ 1
Thank you Mihai Apostol it worked
13th Feb 2020, 4:04 PM
Samuel Addo
Samuel Addo - avatar
0
Samuel Addo You're welcome.
13th Feb 2020, 4:40 PM
Mihai Apostol
Mihai Apostol - avatar