0
Why is my program doesn't adding 1 to note?
note = 0 print("Exercice 1: trouvez la figure de style") print("aimable tyrannie") reponse_1=input() if reponse_1=="oxymore" : note + 1 else: note + 0 print("Exercice 2: trouvez la figure de style") print("l'astre de la nuit") reponse_2=input() if reponse_2=="périphrase" or "periphrase" : note + 1 else: note + 0 print(note, "/10")
4 Respuestas
+ 3
You need to write:
note += 1.
If you only write +, Python will calculate the result but not save it anywhere.
+ 2
Oh OK thank you
+ 2
I think you can remove the else statements, they don't change the value of "note". And your statement with if and or looks wrong. it should be like:
If var == "word1" or var == "word2"
0
Ok thank you I would try it