Search code examples
pythonuser-defined-data-types

What are different types of string/int as in data types that can be input by the person playing a game in python. (I am using pycharm)


How to input an integer data type as a user playing a game? I have tried many things but they don't work. I have tried inputing numbers but they still are strings not integers.


Solution

  • In python3 use:

    x = int(input(3))
    

    and in python2 use:

    input(3)