[Tutor] problem with code

Steven D'Aprano steve at pearwood.info
Tue Sep 1 15:22:09 CEST 2015


On Tue, Sep 01, 2015 at 02:07:51PM +0100, Nathan Clark wrote:

> I have written another basic program out of python, please could you
> instruct me on how to fix it

I assume you are using Python 3, is that correct?

 
> question= input("What is your question)
>     print("Let me think about that")
>     time.sleep(10)  #10 seconds wait
>     print (question)
>     print ("lol")


Indentation is significant in Python, so to fix this, you need to align 
your code to the left-hand margin. You also need to import the time 
module. Lastly, you need to fix the SyntaxError on line 1. You have a 
string with an opening quote, but no closing quote:

    "What is your question

Add a closing quote (and a question mark).


import time
question= input("What is your question?")
print("Let me think about that")
time.sleep(10)  #10 seconds wait
print (question)
print ("lol")



-- 
Steve


More information about the Tutor mailing list