3

I am a beginner in Python programming. Using Python3 for class.

The code I have is:

#!/usr/binpython3
import arduino
def loop():
      contin = True
      while contin:
             userinput = input()
             if userinput == "quit":
                      contin = False
             else:
                      contin = True

I am stuck at the "userinput = input()" portion of my code. For some reason, my program would not ask user for the input. How can I fix this?

Thank you!

2
  • #!/usr/binpython3 shoud be #!/usr/bin/python3. and do you ever call the function loop()? Commented Apr 8, 2017 at 19:58
  • I'm so dumb. Was looking at so many examples of these and completely forgot about calling the function back again. Thank you so very much. Commented Apr 8, 2017 at 20:38

1 Answer 1

3

Are you actually calling the function? That is, are you saying loop() at the end of your code?

Sign up to request clarification or add additional context in comments.

1 Comment

Ughh, that is exactly what I forgot. Didn't realize I had to call it back afterwards, since it was only being defined. Thank you very much.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.