How to solve it using sentinel loop? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

How to solve it using sentinel loop?

Write a program that input two numbers and one operator. It displays the result by performing the operation on the given numbers .If the operator is division’/’, It should check to make sure that the divisor is not equal to zero. if operator is not + ,/,- or * then the program should print invalid operator ,It also asks the user whether he/she wants to calculate another operation. If user enter ‘Y’, it again input numbers and operator and again perform the operation. But if user input ‘N’, program terminate and show the Message “THANK YOU!!!”

21st Dec 2019, 6:01 PM
abdullah
abdullah - avatar
1 Answer
+ 3
I will give you the last part: if input().upper() == 'N': print('THANK YOU!!!') Maybe you can show us, what you have done
21st Dec 2019, 7:08 PM
Coding Cat
Coding Cat - avatar