0
Purpose?
What’s a scenario where you would want or need to type int(“2”) + int(“3”) instead of simply 2 + 3?
2 Antworten
+ 3
When you receive user input. It is a string when you get it.
Let's say, a simple addition calculator.
num1 = int(input("Enter a number"))
num2 = int(input("Enter another number"))
print(num1+num2)
0
thanks!