logo

Crowdly

Browser

Add to Chrome

[25-26] Algorithmique avancée 2 [S3] [SPE]

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!

Consider the following matrix represented as a Python nested list:

carre4 = [

   

[4, 5, 11, 14],

   

[15, 10, 8, 1],

   

[6, 3, 13, 12],

   

[9, 16, 2, 7]

]

Write the Python statement to print the value 10.

Hint: Use print, the list name, and the appropriate indices. Avoid unnecessary whitespace and negative indices.

View this question

What does the following Python code print?

T = [v**

3 for v in range(1, 10) if v%4==0

]

print(T[:2

])

Note: Use square brackets if needed, but avoid adding spaces

View this question

How to create a list of multiples of 7 between 14 and 49?

View this question

Consider the following Python code:

a = [1, 2, 3

]

a = [str(x)

for x in

a]

print(a[

1] + a[2])

What does it print on the screen?

View this question

What's the console output of the following code:

a = [i*i for i in range(5)]

print(a[-1])

View this question

What's the output of:

[a + b for a in ('1', '2', '3') for b in ('4', '5', '6')]
0%
0%
0%
0%
View this question
0%
0%
0%
0%
View this question

What does this code return?

entiers = [i for i in range(0, 5)]

print(entiers)
0%
0%
0%
0%
0%
View this question

Given the following code :

def multipleOf10(x):

"""

x -- integer

return true if x is a multiple of 10, False otherwise

"""

return x%10 == 0

def filter(my_list, my_function):

"""

my_list -- a list of integers

my_function -- a function that returns a boolean and receives an int

returns the list of results from my_function applied on the list my_list

"""

return [elt for elt in liste if fonction(elt)]

What is the output of filter([i*j for i in range(1,10) for j in range(1,10)], multipleOf10) ?

0%
0%
0%
0%
View this question

After the following assignment:

alpha = [x for x in 'abcdefghijklmnopqrstuvwxyz']

We obtain the letter b by doing

View this question

Want instant access to all verified answers on moodle.esme.fr?

Get Unlimited Answers To Exam Questions - Install Crowdly Extension Now!

Browser

Add to Chrome