I\'m really, really new to Python and was making a small test program.
Here is my code:
def start ():
print (\"This is where text would b
You need an except after the try. It's just a small syntax error; the eof comes from the python parser before it executes the code.
def start ():
print ("This is where text would be")
prompt_sta ()
def prompt_sta ():
prompt_0=raw_input("Input a Command: ")
try:
if prompt_0 == 'Okay':
next_screen ()
else:
print ('Type Okay.')
prompt_sta ()
except Exception as ex:
print (ex)
Here's the link to docs just to save a quick google: https://docs.python.org/3/tutorial/errors.html
For the EOF error, you can just get rid of that try: like so
def start ():
print ("This is where text would be")
prompt_sta ()
def prompt_sta ():
prompt_0=raw_input("Input a Command: ")
if prompt_0 == 'Okay':
next_screen ()
else:
print ('Type Okay.')
prompt_sta()
You can also just add an except clause, as Fernando said, if you still want to use try:
The try
needs an except
clause.