Feb-03-2021, 01:24 AM
Hi! I was coding a program as a little side project that I work on in my spare time and I found a sort of, unwanted occurrence in my program. I want the code to go to the line after I imported another file, and instead, it sends me to the beginning of the file.
Here's the code (main.py to be precise):
Thanks!
Here's the code (main.py to be precise):
print("Good evening ladies,gentlemen and all other configurations of being! I'm Alastor, the radio demon!") print("I have called you here because of your impeccable skills as a thief") ans = input("SO, will you join me on this quest of epic proportions?") if ans == "no": print("Ahaha, this isn't a choice my friend, I shall hold this over your head for later!") stubborn = True else: print("Alright! Let's get to work") stubborn = False import choice print("Great! the guards left should we go in now") if stubborn: print("I don't need to ask do I, we're heading in anyways") else: ans = input("So, should we go inside?") if ans == "yes" or "Yes": print("Yes! Alright, we're heading in.") indecisive = False assertive = False elif ans == "no" or "No": print("Ahaha,too late my friend, i'm already walking in. ") indecisive = False assertive = True else: print("Indecisive eh? I'll keep that in mind") indecisive = True assertive = Falseand here's the second file's code (choice.py):
def breakin(): print() print("Ok! We're here") br = input("How will we get inside sneak in: bust in or wait!") if br == "sneak in": print ("*You snuck in at night from the ceiling*") elif br == "bust in": print("I was hoping you'd say that lets go!") elif br == "wait": print("*you waited for the guards to leave*") import main breakin()And it starts from the beginning.
Thanks!