Python – Débuter – Les bases

# -*- coding:Latin-1 -*-

n = 7

msg = coucou

#une boucle while

a=0

while(a<5):

a = a + 1

#une condition if

if a == 2 :

print(tu es arrivé a : “ , a)

print(a)

print(“\n”)

#len() retourne la longueur de la chaine de caractère

print(print(le mot \”fini\” contient, len(fini), caractères.”))

#un tableau

jour = [lundi, mardi, mercredi, 1800, 20.357, jeudi, vendredi]

print(jour, “\n”)

#boucle for d’un tableau d’objet

for i in jour:

print(str(i))

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s