0

I want to display only the day of the week? someone help me, it doesn't show nothing

week=['monday','tuesday','wednesday','thursday','friday','saturday','sunday'] for n in week: if n== 'saturday' or 'sunday': continue print(n)

22nd Apr 2019, 9:39 AM
Saeb MESSAOUDI
Saeb MESSAOUDI - avatar
5 odpowiedzi
+ 2
hm... if n=='saturday' or n=='sunday': print(n) is that what do you mean?
22nd Apr 2019, 10:03 AM
Sousou
Sousou - avatar
+ 1
Sousou 's answer will work. Another way it could be done (which would make it shorter to write if there are more options) would be: if n in ('saturday','sunday'): continue print(n) edited: apologies for confusion.
22nd Apr 2019, 10:26 AM
Russ
Russ - avatar
0
Thanks for the answers :) , but I want to display just the days week [Monday, Tuesday, Wednesday, Thursday, and Friday] but not the weekend. I've put "continue" to pass the Saturday and Sunday.
22nd Apr 2019, 11:16 AM
Saeb MESSAOUDI
Saeb MESSAOUDI - avatar
0
Sorry, I had misread Sousou's answer. Here's what you needed: https://code.sololearn.com/cq2VFZPX3OPI/?ref=app
22nd Apr 2019, 11:27 AM
Russ
Russ - avatar
0
Greeeat! Thank you so much :)
22nd Apr 2019, 11:59 AM
Saeb MESSAOUDI
Saeb MESSAOUDI - avatar