What is this post about?
This is an audio code dictation to help learners memorize Python syntax. Follow these steps to complete a dictation:
Open a code editor on your computer.
Play the audio and type the narrated code while listening.
Compare your code with the correct code below.
Correct Code
import time
def set_alarm(hours, minutes):
print("Alarm set for", hours, minutes)
current_time = time.localtime()
while current_time.tm_hour != hours or current_time.tm_min != minutes:
current_time = time.localtime()
time.sleep(30)
print("Time's up! Wake up!")
set_alarm(6, 30)
Share this post