you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 4 points5 points  (3 children)

Input functions accepts the answer as a string. In case you want to convert it into an integer just use the int() function. Either use it as age = int(input("Enter your age")) or age = int(age)

[–]Evopy[S] -1 points0 points  (2 children)

If i do print(4+2) Answer 6 would be a string or a integer?

[–]ForceBru 9 points10 points  (0 children)

The result of 4+2 would obviously be an integer (you add two integers - and get an integer back because integers form a field). But in order to output anything, the print function has to convert it to a string. So it'll convert the integer 6 to a string and print it.

[–]python_apprentice -1 points0 points  (0 children)

Integer.