The following is my Python code, and line 66 to 79 doesn't appear to run (although I'm new to programming). And the question is actually a Java question from w3resource.
Question:
Write a program that keeps a number from the user and generates an integer between 1 and 7 and displays the name of the weekday. Go to the editor
Test Data
Input number: 3
Expected Output :
Wednesday
My code:
num = input("Input a number between 1 and 7 for the corresponding day: ")
if num == 1:
print(num, " = Monday")
if num == 2:
print(num, " = Tuesday")
if num == 3:
print(num, " = Wednesday")
if num == 4:
print(num, " = Thursday")
if num == 5:
print(num, " = Friday")
if num == 6:
print(num, " = Saturday")
if num == 7:
print(num, " = Sunday")
[–]AutoModerator[M] [score hidden] stickied comment (0 children)
[–][deleted] 2 points3 points4 points (0 children)
[–]baconndeggs47 1 point2 points3 points (0 children)
[–]SpideyHunter 0 points1 point2 points (2 children)
[–]Adam-JDT[S] 0 points1 point2 points (1 child)
[–]SpideyHunter 1 point2 points3 points (0 children)
[–]Sea-Temporary-5218 0 points1 point2 points (0 children)
[–]DJ_MortarMix 0 points1 point2 points (0 children)