0

I have having trouble coming up with a input validation for my string. I am having the user input 2 numbers. The user would input something like "2(space)3". My validation would include having anything other than a number being inputted go back and re-enter their input. Not asking anyone to write the code, just let me know the easiest way to go about this, I have tried multiple different loops and if statements and not getting anywhere.

print ("\nEquation format: remainder dividor, for example 2 3 means x % 3 = 2\n")
for i in range(0, k):
    print ("Please input equation " + str(i+1))
    s = input()
    a_i, n_i = map(int, s.split())
    a.append(a_i)
    n.append(n_i)
Omar Einea
  • 2,478
  • 7
  • 23
  • 35

0 Answers0