Quick Python Question


#1

Hi guys,

Quick question here, If i ask a question and want the user to input an answer, how do I do it in the code.

thanks


#2

For this site, currently we are using Python 2.7.x so would use, raw_input().

user = raw_input("Enter your answer: ")

Now their answer will be cached in user.

The resulting value will be of type string, so if you wish to obtain numeric input, then wrap that function call with a float() or int() depending on what you expect.


#3

Thank you! :slight_smile:


#4

could you explain, in python, number 15 how to fully solve? I kinda have a bug there with the run too, so I´d want to know how to solve fully and I maybe can pass it please


#5