+ 1

How to take an input while writing a code?

how to save the value and use it in a condition

23rd Aug 2016, 2:28 PM
Aditya Warade
Aditya Warade - avatar
1 Answer
+ 7
Use input function. but remember it always returns string. var1 = input("Enter some string : ") If you want to get integer wrap it in int() var2 = int(input("Enter some integer")) And use float() for getting floats and so on...
23rd Aug 2016, 2:54 PM
Alireza M
Alireza M - avatar