My issue
please explain
My code
# Solution as follows
days = [30, 31, 30, 30, 31, 30, 20, 30, 31, 30, 31, 30]
for day in days:
if day < 30:
print(day)
break
Learning course: Learn Python
Problem Link: CodeChef: Practical coding for everyone
this is how for loop in python works.
day is a variable created to contain the value picked from the list days. item on 1st index will be picked and assigned to variable day. then that variable will enter the loop and will be checked against the condition. If it satisfies the condition then value of the variable day will be printed and it will come out of the loop.Hope this helps!!