Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Code Won't Ask User for Input?

Tags:

python-3.x

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!

like image 588
Someone Avatar asked Aug 26 '26 08:08

Someone


1 Answers

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

like image 79
splinter Avatar answered Aug 28 '26 21:08

splinter