Bucla de comenzi în python

Exemple de cod

1
0

cum să utilizați buclă în python

for i in range (1,10,1)
print(i)
0
0

bucla în python

# A Sample Python program to show loop (unlike many 
# other languages, it doesn't use ++) 
# this is for increment operator here start = 1,  
# stop = 5 and step = 1(by default) 
print("INCREMENTED FOR LOOP") 
for i in range(0, 5): 
   print(i) 
  
# this is for increment operator here start = 5,  
# stop = -1 and step = -1  
print("\n DECREMENTED FOR LOOP") 
for i in range(4, -1, -1): 
   print(i) 

În alte limbi

Această pagină este în alte limbi

Русский
..................................................................................................................
English
..................................................................................................................
Italiano
..................................................................................................................
Polski
..................................................................................................................
한국어
..................................................................................................................
हिन्दी
..................................................................................................................
Français
..................................................................................................................
Türk
..................................................................................................................
Česk
..................................................................................................................
Português
..................................................................................................................
ไทย
..................................................................................................................
中文
..................................................................................................................
Español
..................................................................................................................
Slovenský
..................................................................................................................
Балгарскі
..................................................................................................................
Íslensk
..................................................................................................................