Podcast
Questions and Answers
Quel est le résultat de l’instruction print 2 + 2==4 en Python?
Quel est le résultat de l’instruction print 2 + 2==4 en Python?
- True (correct)
- 4
- False
- Erreur
Quelle est la sortie de ces instructions Python si l’utilisateur saisit 22. age=input() ; print(age+8)?
Quelle est la sortie de ces instructions Python si l’utilisateur saisit 22. age=input() ; print(age+8)?
- Erreur (correct)
- 30
- 22
- 8
Quel est le résultat de l'expression True and False en Python?
Quel est le résultat de l'expression True and False en Python?
- True
- 0
- 1
- False (correct)
En Python, le type d’une variable ne peut pas changer pendant l'exécution du programme.
En Python, le type d’une variable ne peut pas changer pendant l'exécution du programme.
À quoi sert l'instruction continue en Python?
À quoi sert l'instruction continue en Python?
Quelle est la sortie du code suivant en Python . for i in range(3): print(i,end=''); break else: print(2)
Quelle est la sortie du code suivant en Python . for i in range(3): print(i,end=''); break else: print(2)
Quelle est la sortie de l’instruction suivante en Python: print('Bonjour, monde.'[:3])
Quelle est la sortie de l’instruction suivante en Python: print('Bonjour, monde.'[:3])
Comment peut-on obtenir un nombre flottant aléatoire entre 0 et 1 avec le module random en Python?
Comment peut-on obtenir un nombre flottant aléatoire entre 0 et 1 avec le module random en Python?
Quelle est la fonction du module random qui génère un entier aléatoire entre 5 (inclus) et 10 (exclus) en Python?
Quelle est la fonction du module random qui génère un entier aléatoire entre 5 (inclus) et 10 (exclus) en Python?
Quelle est la sortie du code suivant en Python: if(True): print(1//2)
Quelle est la sortie du code suivant en Python: if(True): print(1//2)
Flashcards
Python print(2 + 2 == 4)
output
Python print(2 + 2 == 4)
output
The expression 2 + 2 == 4
evaluates to True
in Python. The print()
function displays this result.
Python input()
error with addition
Python input()
error with addition
Trying to directly add the user input (which is a string) to a number will result in an error if it is not an integer.
Python True and False
Python True and False
The expression True and False
evaluates to False
in Python.
Python variable type immutability
Python variable type immutability
Signup and view all the flashcards
Python continue
statement
Python continue
statement
Signup and view all the flashcards
Python for i in range(3):
problem
Python for i in range(3):
problem
Signup and view all the flashcards
Python string slicing 'Bonjour, monde.'[:3]
Python string slicing 'Bonjour, monde.'[:3]
Signup and view all the flashcards
Python random float
Python random float
Signup and view all the flashcards
Python random integer
Python random integer
Signup and view all the flashcards
Python if(True): print(1//2)
Python if(True): print(1//2)
Signup and view all the flashcards