0

Help me fix the error

I want to code a program that told you the number that symbolizes the day of the week. For example: 1 is Monday. 7 is Sunday ect.. But when I finished I had an error.. Can you HELP me !! https://code.sololearn.com/cqU0UMWZ764I/?ref=app

10th Jun 2019, 3:24 PM
Nada El Annasi
Nada El Annasi - avatar
7 odpowiedzi
+ 2
y = int(input('Enter the day of the week\'s number: ')) if y==1: print('It\'s Monday') if y==2: print('It\'s Tuesday') if y==3: print('It\'s Wednesday') if y==4: print('It\'s Thursday') if y==5: print('It\'s Friday') if y==6: print('It\'s Saturday') if y==7: print('It\'s Sunday')
10th Jun 2019, 3:32 PM
Cat Sauce
Cat Sauce - avatar
+ 2
Cat Sauce, Farry Thank you all 😊
15th Jun 2019, 5:12 PM
Nada El Annasi
Nada El Annasi - avatar
+ 1
you have indentation bug. an four space indentation defines a block. you have everything in the if statement for monday. nothing will ever show if it's not monday. remove the spaces from the if statements
10th Jun 2019, 3:34 PM
Farry
Farry - avatar
10th Jun 2019, 3:46 PM
Nada El Annasi
Nada El Annasi - avatar
+ 1
Nada El Annasi if you do "if x = 1:" the code is giving x the value 1 but if you do "if x == 1:" it is checking if x is equel to 1
10th Jun 2019, 4:03 PM
Cat Sauce
Cat Sauce - avatar
0
https://code.sololearn.com/cqU0UMWZ764I/?ref=app I edited it.. But it still the same error..
10th Jun 2019, 3:32 PM
Nada El Annasi
Nada El Annasi - avatar
0
But why we did. >>> if x == 1 And not >>> if x = 1
10th Jun 2019, 3:49 PM
Nada El Annasi
Nada El Annasi - avatar