How to take inputs?


#1

So I started learining Python a few days ago and I really like learning it. My question is is there and way to take input not by writing something in code, but by “asking” a person who is using your program. You just insert a number or something like that and the program takes it as an input. I am 90 % sure that you can do it, I just don’t know how :frowning:


#2

python has built-in functions for this, the function you need to use depends on the python version you are using. python2 use raw_input() and in python3 use input(), if you want numbers, you might need to do casting to the appropriate data type


#3

Thank you very much! Now when I tested it I remembered that i learned it before, i just forgot this.


#4

python has official documentation:

http://docs.python.org/

as well as a page with all the built-in functions:

https://docs.python.org/2/library/functions.html

but using google you will often get there