I found an exercise on the internet and i can't solve it. It asks to make a program that makes the user decide if it wants to use decimals or integers, makes them insert how many numbers they want and stops when the user inserts a string instead of a number
x=("n")
h=str(input("would you like to use decimals or integers "))
z=["decimals","decimal"]
k=["integers","integer"]
while o==True:
if h not in k and z:
print ("insert")
o=False
elif h not in k:
u0=float(input("insert number "))
v=u0
if v==x:
print ("the sum is ",u, " the product is ", m)
o=False
u=u0+j
m=u0*d
j=u
d=m
I tryed inverting the way the programs work, making it so that you entered numbers that where treated like strings until the program checked that they were not te string to make the program stop and than converting it into a float/integer.
the error message that pops up is:
u0=int(input("insert number ")), ValueError: invalid literal for int() with base 10: 'n'