renommé : entier.py -> 1/entier.py
renommé : exo1.py -> 1/exo1.py renommé : exo2.py -> 1/exo2.py renommé : exo3.py -> 1/exo3.py renommé : exo3b.py -> 1/exo3b.py renommé : first.py -> 1/first.py renommé : loop.py -> 1/loop.py renommé : math0.py -> 1/math0.py renommé : string0.py -> 1/string0.py nouveau fichier : 2Prog.md
This commit is contained in:
21
python/1/exo1.py
Normal file
21
python/1/exo1.py
Normal file
@@ -0,0 +1,21 @@
|
||||
# Ecrire une suitre de commande qui
|
||||
# demande votre prénom, votre nom, votre age et affiche
|
||||
# "Pierre Valarcher tu as XXX ans"
|
||||
|
||||
prenom = input("Votre prénom : ")
|
||||
nom = input("Votre nom : ")
|
||||
age = int(input("Votre age : "))
|
||||
|
||||
print(prenom, nom, "tu as", age, "ans")
|
||||
|
||||
phrase = prenom + ' ' + nom + ", tu as " + str(age) + " ans"
|
||||
# + est la concaténation sur les chaines de caractères
|
||||
|
||||
prenom = "Paul"
|
||||
print(prenom, nom, "tu as", age, "ans")
|
||||
|
||||
|
||||
if age <= 40:
|
||||
print("tu es jeune")
|
||||
else:
|
||||
print("tu es plutot vieux/vieille")
|
Reference in New Issue
Block a user