+ 2

input in python

Please, help me , how to use input in python? I am beginner so dont understand some other function except of output and result which clear to recognize! Thanks!

25th Mar 2017, 10:59 AM
Nasibillo Muhamedov
Nasibillo Muhamedov - avatar
3 Answers
+ 14
input() # ^there it is text=input("this is if you want to assign a variable to an input. also, you can put a text message before the input field like this. although this doesn't work too well in sololearn") # ps, Hubert's explanation was better imo
25th Mar 2017, 11:41 AM
Ahri Fox
Ahri Fox - avatar
+ 3
thanks much you helped me more
26th Mar 2017, 2:35 PM
Nasibillo Muhamedov
Nasibillo Muhamedov - avatar
+ 2
You write code like this: a = input('Enter number') This program writes on user's screen 'Enter number'. User types answer, for example '99' and then in a variable 'a' is stored user's input (in this exapmle it is 99). Then you use this variable like a normal variable. You can print it, add anything to it, divide it etc. Input can be integer, string, float... Whatever you want. P.S. thanks Ahri
25th Mar 2017, 11:42 AM
Hubert
Hubert - avatar