UPDATED ACTUAL Questions and
CORRECT Answers
reverse list in Python - CORRECT ANSWER - [::-1]
join list in Python - CORRECT ANSWER - ''.join([list])
return the largest integer not greater than x - CORRECT ANSWER - math.floor()
return the smallest integer not less than x - CORRECT ANSWER - math.ceil()
python round call - CORRECT ANSWER - round(x, 2); first argument is the number and
the second argument is the precision after the decimal point
list comprehension with if-else statement - CORRECT ANSWER - [f(x) if condition else
g(x) for x in sequence]
list comprehension with if statement - CORRECT ANSWER - [f(x) for x in sequence if
condition]
create a tuple - CORRECT ANSWER - tuple((x, y, z)) OR (x, y, z)
get index in list comprehension - CORRECT ANSWER - [i for i, x in enumerate(L) if x
<= threshold]
check if list (L) is empty - CORRECT ANSWER - if not L: