>While loops are called ‘Indefinite loops’(repeats until the statement as long as a condition is true).
>For loops are called ‘Definite loops’(allows shorten what 100 line of code just a few line of code),
For loops are used to iterate over a sequence (such as a list, tuple, or string) or a range of numbers.
n = 5
while n > 0:
print(n)
n = n - 1
print('blastoff!')
print(n)
$ C:/python/Python311/python.exe c:/Users/LENOVO/OneDrive/Desktop/python/hello.py 5 4 3 2 1 blastoff! 0
n = 5
while n > 0:
print('####################### #######################')
print('####################### #######################')
print('### ')
print('### ')
print('### ')
print('### ')
print('###################### ####')
print('###################### ####')
print(' ### ')
print(' ### ')
print(' ### ')
print(' ### ')
print('###################### #######################')
print('###################### #######################')
This prints an endless of the word inserted SI,
$ C:/python/Python311/python.exe c:/Users/LENOVO/OneDrive/Desktop/python/hello.py ####################### ####################### ####################### #######################
###
###
###
###