In this program, we will print the numbers before a number.
Steps to solve the program
- Create a variable and assign its value equal to 1.
- While the value of the variable is less than 11 print the number.
- Add 1 to the variable.
- If the value of the variable is equal to 6 break the loop.
#81
count = 1
while count < 11:
print(count)
count += 1
if count == 6:
break
Output :
1
2
3
4
5