Pentru bucla eu în python

Exemple de cod

2
0

cum să utilizați-o pentru buclă în python

a_list = [1,2,3,4,5]

#this loops through each element in the list and sets it equal to x
for x in a_list:
	print(x)
0
0

pentru buclă în python


data = [34,56,78,23]
sum = 0
# for loop is to iterate and do same operation again an again
# "in" is identity operator which is used to check weather data is present or not
for i in data:
  sum +=i
  
print(sum)
  

În alte limbi

Această pagină este în alte limbi

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