Hi I was making a script y'now, just for fun and I came across a small problem.
The way my code needs to work, I need to recall a script but to do that it needs to be recalled in a recall of another script.
I know kinda confusing but it makes a little more sense in the script. Here's my code:
# Importing time and date...
import time
import datetime
# Defining ans() and name().
def ans():
print("Are you sure your name is Vegas?")
time.sleep(2)
print("Well I'm not so sure.")
time.sleep(1)
print("You'll have to prove it.")
time.sleep(1)
print("Which typewriter brand does Vegas have?")
print("1. Sizzix")
print("2. Royal")
print("3. Alivetti")
print("4. Smith-Corona")
ans=input(">")
if ans == "4":
print("Correct....")
else:
print("Incorrect! You are not Vegas! Liar!")
name()
def name():
name=0
print("Detecting...")
time.sleep(2)
name == input("Is your name Vegas? (Y or N) >")
if name == "Y":
ans()
if name == "N":
name()
# Now for the actual script. This prints the time and then runs the code in name().
now = datetime.datetime.now()
print(now, " --That is the time.")
name()
# If name == Y, then it's supposed to go to ans() and run the code there.
# Instead it goes through the code inside name() and then stops.
All the big font is just stuff I used as notes (#). I was making this script for my friend whose name is Vegas so that explains that.