cours3
This commit is contained in:
11
python/1/ex22.py
Executable file
11
python/1/ex22.py
Executable file
@@ -0,0 +1,11 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
# consonnes = ['a', 'e', 'i', 'o', 'u', 'y']
|
||||
|
||||
cpt = 0
|
||||
phrase = input("Ecrire une phrase : ")
|
||||
for i in phrase:
|
||||
if i == 'a' or i == 'e' or i == 'i' or i == 'o' or i == 'u' or i == 'y':
|
||||
cpt = cpt + 1
|
||||
|
||||
print("Il y a", cpt, "consonnes dans la phrase: ", phrase)
|
17
python/1/ex2c.py
Executable file
17
python/1/ex2c.py
Executable file
@@ -0,0 +1,17 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
note = int(input("Entrer une note [entre 0 et 20] : "))
|
||||
mention = ""
|
||||
|
||||
if (note >= 10) and (note < 12):
|
||||
mention = "Passable"
|
||||
print ("La note ", note, "correspond à la mention ", mention)
|
||||
elif (note >=12) and (note < 14):
|
||||
mention = "Assez Bien"
|
||||
print ("La note ", note, "correspond à la mention ", mention)
|
||||
elif note>=14 and note < 16:
|
||||
mention = "Bien"
|
||||
print ("La note ", note, "correspond à la mention ", mention)
|
||||
elif note >= 16:
|
||||
mention = "Très Bien"
|
||||
print ("La note ", note, "correspond à la mention ", mention)
|
Reference in New Issue
Block a user