I have to make a program using while
that:
Will ask for user to put 2 integer numbers and give back the addition and multiplication of those 2.
Will check if the numbers are integers.
Will close if the user uses the word
stop
.
I have made 1 and 2 but am stuck on 3. Here is what I wrote:
while True:
try:
x = int(input("Give an integer for x"))
c = int(input("Give an integer for c"))
if x=="stop":
break
except:
print(" Try again and use an integer please ")
continue
t = x + c
f = x * c
print("the result is:", t, f)