1.

Page No.el n'Write a python programinput two numbers and y by theuser and print their sum andProduct in new line usingnewline character​

Answer»

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.


Discussion

No Comment Found