Page No.
el n'
Write a python program
input two numbers and y by the
user and print their sum and
Product in new line using
newline character
Answers
Answered by
1
Program
x = int(input("Enter the first number:\n"))
y = int(input("Enter the second number:\n"))
sum = x + y
product = x*y
print("The sum of the two numbers you have entered is " , str(sum)+ ".\n The product of the two numbers you have entered is", str(product)+ ".")
Explanation
- I have used typecasting to convert str( input functions is of string datatype.) to int.
- Then i have used \n ( string sequence character) to introduce a new line as asked in the question.
Attachments:
Similar questions