Ask coding questions

← Back to all posts
Help. Winsound isn't a module and line 24 & 25 don't work.

import time
import winsound
import random

ri = random.randint(1, 15)

print("Hello, welcome to Alien Outrage!")
winsound.Beep(432, 1)
print("We are currently loading your game.")
winsound.Beep(432, 1)
print("Estimated waiting time: ", + ri)
winsound.Beep(432, 1)
winsound.Beep(432, 1)

name = input("What is your name?\n")
print("I like that name, ",+ name, ".")
print("Let's start.")
i1 = input("Would you like to leave? yes or no")
if i1 == "yes":
print("On the way there, you've realized you've forgot a vital resource. Too bad!")
elif i1 == "no":
print("You have forgot your water, so you were thankful you stayed.")
i2 = input("You've left and you're at a bus stop. Would you like to wait or leave? wait or leave")
if i2 == "wait":
print("You have been picked up by your friend. You've made it!")
elif i2 == "leave":
i3 = input("You leave and you begin to be hungry. Eat? yes or no")
if i3 == "yes":
print("You've accidentally eaten more than you should have. Later you ran out of food and you died. Too bad!")
elif i3 == "no":
print("Good thing you ate alot before you left! The game end here cuz theres no more time to complete.")

I need help please and im new to python 3 i havent ever done it ive only started 4 weeks ago


1) you need to install any libraries you want to use in the package manager just click the crate icon on the sidebar on the left and install the package.
2) you should indent properly as it is part of syntax


@MrEconomical Thanks, I have indented, but I copied and pasted from Geany. I use this to execute my scripts. And the package manager fixed my problem. I just need to fix line 24 and 25.


@PrestonLevy can you show the error message?