x1=input("Enter first number: ")
x2=input("Enter second number: ")
print("Total :",x1+x2)
Output
Enter first number: 3
Enter second number: 4
Total : 34
Why the output is not equal to 7 with input of 3 and 4 as input numbers ? x1=int(input("Enter first number: "))
x2=int(input("Enter second number: "))
print("Total :",x1+x2)
Output
Enter first number: 3
Enter second number: 4
Total : 7
x1=float(input("Interest Rate is : "))
print ("interest rate ",x1)
Output
Interest Rate is : 5.6
interest rate 5.6
sum=0
for i in range(3):
x1=int(input('Enter a number'))
sum=sum+x1
print("Sum : ", sum)
Author
🎥 Join me live on YouTubePassionate about coding and teaching, I publish practical tutorials on PHP, Python, JavaScript, SQL, and web development. My goal is to make learning simple, engaging, and project‑oriented with real examples and source code.