Some problems I don't know whats wrong | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

Some problems I don't know whats wrong

today=input() if today=="mon"or"tue"or"wed"or"thur"or"fri": print("go to work") elif today=="sat"or"sun": print("have a nice holiday") Why is still need to go to work at sat and sun

20th May 2022, 10:12 AM
Cham Sum Lau
6 Answers
+ 3
It needs to be if today == "mon" or today == "tue" and so on (not today == "mon" or "tue"). Yhe same applies for the remaining part of the condition and the elif-condition. Another approach could be using a list: if today in ["mon", "tue", ...]
20th May 2022, 10:23 AM
Lisa
Lisa - avatar
0
Thanks you...i try that first
20th May 2022, 10:24 AM
Cham Sum Lau
0
It needs to be if today == "mon" or today == "tue" and so on (not today == "mon" or "tue"). Yhe same applies for the remaining part of the condition and the elif-condition. Another approach could be using a list: if today in ["mon", "tue", ...]I m sorry , i dont understand how to do it as a the list
20th May 2022, 3:23 PM
Cham Sum Lau
0
Cham Sum Lau No need to copy my answer
20th May 2022, 3:26 PM
Lisa
Lisa - avatar
0
Sorry...wrong operations But i still don't know how to do it as list Btw, thank you very much ... I can do that in the first way now
20th May 2022, 3:27 PM
Cham Sum Lau
0
Don't worry, list will be explained in the course
20th May 2022, 3:28 PM
Lisa
Lisa - avatar