What is output of following python code.
Num1= int(input("Enter first number"))
Num2 = int(input("Enter second number"))
Print(num1 + num2)
Answers
Answer:
If there is no typing mistake then output will be error.
And
If there is typing mistake in function "print" instead of "Print". then the output of code will be sum of two number entered by user at run-time.
Explanation:
Example:
Num1= int(input("Enter first number"))
Here we using input function, that ask for input from user at run-time.
After that we are doing type casting so that number entered by user should be integer.
Let suppose user gives the input 10
now 10 will be assigned to variable Num1.
Num2= int(input("Enter first number"))
Here also, suppose user gives the input 20
now 20 will be assigned to variable Num2.
Now we calling to print function to print the sum of Num1 And Num2
Num1 = 10
Num2 = 20
Num1 + Num2 = 30
So 30 will be printed by print function.