Last Updated: January 3, 2026
28 quizzes
Apply a transformation to every temperature to convert the list from Celsius to Fahrenheit and store the result.
fahrenheit_values = map(, celsius_values)Click an option to fill the blank:
Create an iterator that only keeps positive scores from a list of numbers.
positive_scores = filter(, scores)Click an option to fill the blank:
Create a sequence of indexes for a list of tasks so you can iterate over their positions.
indexes = list((tasks))Click an option to fill the blank:
Which built-in function is best to combine two lists element by element into pairs?
You have user records as a list of dictionaries. Which argument of sorted lets you sort by the 'age' key?
Which statement about any() is correct?
You need the total price from a list of numeric item prices. Which built-in is the most direct?
Which expression correctly checks that all items in scores are greater than or equal to 60?
Which call to range produces the sequence 2, 4, 6, 8?
You want to verify that user_input is specifically a str (not a subclass). Which is most precise?
Which built-in is best for turning several same-length lists into a list of tuples for each row of a table?
What does eval('3 * 5') return?
Which built-in would you use to quickly check how many key-value pairs are in a dictionary config?
Order the steps to use reduce to compute the product of all numbers in a list.
Drag and drop to reorder, or use the arrows.
Arrange the steps to safely evaluate a user-provided arithmetic expression with eval using a restricted namespace.
Drag and drop to reorder, or use the arrows.
What is the output of this code?
1values = [1, 2, 3, 4]
2result = list(map(lambda x: x * 2, values))
3print(result[1] + result[-1])What does this code print?
1names = ['Ana', 'Bob', 'Cara']
2for index, name in enumerate(names, start=1):
3 labeled = f"{index}-{name}"
4print(labeled)What is the output of this code?
1scores = [70, 85, 90]
2passed = all(score >= 70 for score in scores)
3print(passed)What is printed by this code?
1letters = ['b', 'a', 'c']
2print(''.join(sorted(letters)))What is the output of this code?
1data = [10, 20, 30]
2total = sum(data)
3minimum = min(data)
4print(total - minimum)Find the bug in this code that checks if all email addresses contain '@'.
Click on the line(s) that contain the bug.
def all_valid_emails(emails): checks = ["@" in email for email in emails] if any(checks): return True return FalseIdentify and fix the bug in this code intended to pair product IDs and names.
Click on the line(s) that contain the bug.
def pair_products(ids, names): pairs = list(zip(ids)) if len(pairs) == len(ids): return pairs return []Match each built-in with what it primarily returns.
Click an item on the left, then click its match on the right. Click a matched item to unmatch.
Match each concept with the most appropriate built-in function.
Click an item on the left, then click its match on the right. Click a matched item to unmatch.
Complete the code to filter even numbers and then compute their total.
numbers = [1, 2, 3, 4, 5, 6]evens = filter(, numbers)total_evens = (evens)print(total_evens)Click an option to fill blank 1:
Complete the code to sort students by age in descending order.
students = [{'name': 'Ana', 'age': 21}, {'name': 'Bob', 'age': 19}]by_age_desc = sorted(students, key=, reverse=)print(by_age_desc[0]['name'])Click an option to fill blank 1:
Click the line that will raise an error when run.
Click on the line to select.
items = Noneprint(len(items))print(type(items))Click the line that incorrectly uses eval in a way that can run unexpected code.
Click on the line to select.
expression = input('Enter a number: ')value = eval(expression)print(value * 2)