Complete the code to import the module needed to measure time.
import [1]
The time module lets us measure time intervals, which is important for a reaction time game.
Complete the code to wait for a random time between 1 and 3 seconds before starting the reaction timer.
import random import time wait_time = random.[1](1, 3) time.sleep(wait_time)
random.randint(1, 3) picks a whole number between 1 and 3 seconds to wait.
Fix the error in the code that measures the reaction time by capturing start and end times.
start = time.[1]() # wait for user input here end = time.perf_counter() reaction_time = end - start
time.perf_counter() gives a precise timer for measuring short durations like reaction time.
Fill both blanks to create a dictionary that stores reaction times for each player if their time is less than 2 seconds.
reaction_times = {player: [1] for player, [2] in results.items() if [1] < 2}The dictionary comprehension uses time as the value and time as the variable for the reaction time in the loop.
Fill all three blanks to create a dictionary comprehension that stores uppercase player names as keys and their scores if scores are above 0.
high_scores = { [1]: [2] for [3], [2] in scores.items() if [2] > 0}The keys are uppercase player names using player.upper(), values are score, and the loop variables are player and score.