+ 1

How to take user input in Python​?

19th May 2017, 2:13 PM
CRYPTONaXE
CRYPTONaXE - avatar
4 ответов
+ 6
Just remember that input() always returns a string type. If you want to have a number, you have to convert it somewhere along the way or right away: x = float(input('That will return a float: ')) y = int(input('And that will return an integer: '))
19th May 2017, 4:39 PM
Kuba Siekierzyński
Kuba Siekierzyński - avatar
+ 2
x = input()
19th May 2017, 2:20 PM
_Retr0/-
_Retr0/- - avatar
+ 2
x = input("whatever")
19th May 2017, 2:21 PM
_Retr0/-
_Retr0/- - avatar
+ 1
thanks
19th May 2017, 3:07 PM
CRYPTONaXE
CRYPTONaXE - avatar