Python 3 - Repetition / Loops with For

preview_player
Показать описание
A look at how to repeat things in Python using For, and an explanation of the arguments for the range() keyword.

Once you know how to use a FOR loop, you can easily create things like times tables or Ten Green Bottles:

Рекомендации по теме
Комментарии
Автор

i liked this i was searching for this every video in for loop was for numbers except helped me get 100 marks instead of, subscribed!!!

monicagandhi
Автор

var=0
for var in range (1, 26): # input 25 times - regress testing
n=int(input('Enter an Integer: '))
flag=True
if (n==2):
print('Prime number')
elif n!=2:
for i in range (2, n):
if(n%i==0):
flag = False
print('Not prime number')
break
else:
print ('Prime number')

seasonz
Автор

is there a way this can be made into a endless loop

fernandocruz
Автор

How can I only make it do even number or odd?

AlbionofRunescape