Bucle for me en python

Ejemplos de código

2
0

cómo utilizar un bucle for en 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

bucle for de 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)
  

En otros idiomas

Esta página está en otros idiomas

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