Ask Question
4 July, 00:51

Write a while loop that asks the user to enter two numbers. the numbers should be added and the sum displayed the loop should ask the user if he or she wishes to perform the operation again. if so, the loop should repeat, otherwise it should terminate.

+3
Answers (1)
  1. 4 July, 02:06
    0
    Int repeat = 'y'

    while repeat = = 'y':

    num1 = int (input ("Enter first number: "))

    num2 = int (input ("Enter second number: "))

    sum = num1+num2

    print ("The sum is : "+str (sum))

    repeat = int (input ("Try another? (y/n) "))
Know the Answer?
Not Sure About the Answer?
Get an answer to your question ✅ “Write a while loop that asks the user to enter two numbers. the numbers should be added and the sum displayed the loop should ask the user ...” in 📙 Computers & Technology if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers