Looking for [25-26] Algorithmique avancée 2 [S3] [SPE] test answers and solutions? Browse our comprehensive collection of verified answers for [25-26] Algorithmique avancée 2 [S3] [SPE] at moodle.esme.fr.
Get instant access to accurate answers and detailed explanations for your course questions. Our community-driven platform helps students succeed!
What does this Python code return?
temps = [12, -3, 0, 22, 8]
categories = ["Cold" if t < 10 else "Mild" if t < 20 else "Hot" for t in temps]
print(categories)
What is the value of matrix after this code?
matrix = [[i * j for j in range(3)] for i in range(2)]
What does the following list return[x*2 for x in range(4)]
What is the Python interpreter's response on the last line?
a = [i*i for i in range(5)]print(a[-1])What is the output?[x + y for x, y in zip([1, 2, 3], [4, 5, 6])]
What does this code return?[word[::-1] for word in ["bonjour", "à", "tous"] if len(word) > 2]
What is the output of this code?[x**2 for x in range(5) if x % 2 == 0]
What does this list comprehension return?[x*y for x in range(1, 3) for y in range(1, 4)]
What is the output of the following code?[x if x % 2 == 0 else -x for x in range(5)]
What is the output of this expression?
[x for x in range(6) if x % 2 == 0]