Cum pot folosi pentru buclă în python

Exemple de cod

2
0

python cum să bucla

for _ in range(1,10,2): #(initial,final but not included, gap) (the "_" underscore symbol mean there are no variables initialize in this loop)
	print("hi");
0
0

python buclă

for i in range(amount of times in intager form):
	#do stuff
    print(i)# you could use i as a variable. You could set it as u, ool, or anything you want. No blancs tho.
    # i will be the amount of times the loop has been ran. You the first lap it will be 0, the second lap it will be 1. You get it.

În alte limbi

Această pagină este în alte limbi

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