numbers
, contient 4 chiffres :numbers = [0,1,2,3]
fruits
, 3 noms de fruitsfruits = ["apple","banana","orange"]
[
et ]
et … un ensemble de données séparées par des virgules ,
.append()
, par exemple:lst = [] # this a list, but it's empty ! for i in range(3): lst.append(i) print(lst)
[0,1,2]
for
for f in fruits: print("I like " + f + " !")
I like apple ! I like banana ! I like orange !
0
.pomme = fruits[0] banane = fruits[1]
print("I like " + pomme + "s !")
>>> I like apples !
Site sous licence Creative Commons BY-NC-ND v4.0 : Milovann Yanatchkov