0
I have question, why int(input()) why? Like i get question x = int(intput()) y = int(input()) why ?
3 Respuestas
0
x = int(input()) so you can perform operations on 'x' as it is int instead of default string. For example if you want multiplication then:
x = input() # let's make it '2'
x*=3 # x = "222"
But if we cast input to int:
x = int(input()) # let's make it 2
x*=3 # x = 6
+ 1
Input gets input from the user (as a string), int converts it to a number. Then you can use it for calculations
0
Yes,its right,but why int(input)
I'm not discounted