Satan
The King of Hell
|
|
I need Python help!!
|
#1
|
|
Not sure if I post this here buuuut I was writing a tutorial for a text based game I was making...
Then I got stuck, I've searched all over the internet but I cannot find a way to fix this.
Code:
def hello():
'''One of the many hellos'''
print('Hello, this is great, but lets continue.')
def hi():
'''One of the many... his...'''
print('Hi, ready to stop fooling around now?')
import time
time.sleep (1)
answer_is = input('Great! Now lets continue with a reasponse\ntry saying "Hello or Hi."\n>')
if answer_is in ('hello', 'hello.', 'Hello','Hello.'):
hello()
elif answer_is in ('hi, Hi, hi., Hi.'):
hi()
else:
print ('Please reaspond with "Hello" or "Hi")
When you hit Enter you get "Hi, ready to stop fooling around now?" instead of "Please reaspond with "Hello" or "Hi"" and lets say you type the wrong thing it gives you "Please reaspond with "Hello" or "Hi"" then continues the tutorial.
I'd like it to be returned back to "Try saying Hello or Hi" instead of continuing, I can't seem to get it to work how I want it to :( and return doesn't work without a function but I can't get "def function" to work with if and else.
And later on I'm going to make multiple doors/paths, how would I go about multiple if elif without making a huge mess?
Also on IMVU @SaturnineCT if you add me let me know you found me on Trisphee.
|
|
Posted 09-11-2017, 01:15 PM
|
|
|