Behind this set of code below, there are two implementation defined function, their function is the same, I just want to give the first part of the specified argument, the second part with the input input parameters, but it was a mystery to me, the result of the specific code is as follows,
Def add (a, b) :
Print (" ADDING f {a} + {b} ")
The return of a + b
Age=add (30, 5)
Print (f "age: {age}")
Age2=add (input (), input ())
Print (f "age2: {age2}")
The running result is
ADDING: 30 + 5
Age: 35
30 # this number is I manually input the parameters of the
5 # is the same number I manually input the parameters of the
ADDING: 30 + 5
Age2:305
The great god, don't know I write clear? According to my understanding, and finally the result of the execution should be the same, why is the age of 35, age2 was 305, why is 30 + 5 305?
CodePudding user response:
Input is a string, need to turn the integerAge2=add (int (input ()), int (input ()))
CodePudding user response: