(Jul-23-2019, 02:48 AM)leodavinci1990 Wrote: How can I get the same functionality of Python 2.0's input() function?Use int() or float() like this.
data = int(input("Enter any value: ")) print(f'{data} is of type: {type(data)}')
Output:Enter any value: 5
5 is of type: <class 'int'>
input()
in Python 2 should no be used because it had eval()
,so i lot posts was made that should never use input()
in Python 2.Python 3
input()
just string,but can use int() and float() as showed.