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 random
target_number = random.randint(1, 10)
guess = int(input("Guess the number (between 1 and 10): "))
if guess == target_number:
print("Congratulations! You guessed the right number.")
else:
print(f"Sorry, the correct number was {target_number}.")
Share this post