0 points

Print the name of 7 days in a week - by using while loop


dashboard

Tue Apr 21 2020 05:36:09 GMT+0000 (UTC)

Posted by @Radions #python #python #loops #whileloop

days = 0
week = [‘Monday’, ‘Tuesday’, ‘Wednesday’, ‘Thursday’, ‘Friday’, ‘Saturday’, 3.‘Sunday’]
while day < 7:
print(“Today is” + week[days])
days += 1
                                
                                
content_copy Copy

The above code is simple while loop that print the name of 7 days in a week. Like when you run this code the output will be: Today is Monday. Today is Tuesday. So on...

https://www.freecodecamp.org/news/python-example/