Ask coding questions

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

import time
import winsound
import random

ri = random.randint(1, 15)

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

name = input("What is your name?\n")
print("I like that name, ",+ name, ".")
time.sleep(1)
print("Let's start.")
time.sleep(1)
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

Voters
PrestonLevy
Comments
hotnewtop
MrEconomical

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

PrestonLevy

@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.

MrEconomical

@PrestonLevy can you show the error message?