Jul-23-2019, 02:48 AM
If I want to enter a value of a certain data type other than string class <str> into a an input() function. How can this be done. In Python 2.0, there were two input functions, input() and raw_input. input() return whatever value was entered and raw_input() converted all inputs to str. input() & raw_input were combined into input() in Python 3.0
How can I get the same functionality of Python 2.0's input() function?
For example: display data type of any entered value
How can I get the same functionality of Python 2.0's input() function?
For example: display data type of any entered value
data = input("Enter any value:") print(data, " is of type: ", type(data))I want to enter 1 and return a data type class <int> for example or the same with list, float, dict