Hello Gribouillis
Thank you for your prompt reply and I have made the changes you suggest but still do not get the output as the day name. Please see below
Enter a number 0 to 6: 2
The day of the week is Invalid number
>>>
And the output is:
Hello Gribouillis and Buran
Thanks for all your help problem solved and I understand why.
Thank you for your prompt reply and I have made the changes you suggest but still do not get the output as the day name. Please see below
n = input("Enter a number 0 to 6: ") day_of_the_week = n def day_of_the_week (n): if n == 0: return "Sunday" elif n == 1: return "Monday" elif n == 2: return "Tuesday" elif n == 3: return "Wednesday" elif n == 4: return "Thursday" elif n == 5: return "Friday" elif n == 6: return "Saturday" else: return "Invalid number" print("The day of the week is ", day_of_the_week(n))= RESTART: C:/Users/John/Documents/John''s files/Work/Coding/Think Like a Computer Scientist/Programmes/day_of_the_week.py
Enter a number 0 to 6: 2
The day of the week is Invalid number
>>>
And the output is:
Output:
Hello Gribouillis and Buran
Thanks for all your help problem solved and I understand why.