0

How do i get this program repeat when 'again' gets 'Y' or 'y'? Yesterday the same code worked smh, but today it closes the program whatever i write in there) And yeah...tabulation is wrong but it's because stackoverflow copied it in some weird way :))

while True:   
    start = input("What do you want to do? + - * /  ")
    if start == '+':
        x = float(input("digit 1  "))   
        y = float(input("digit 2  "))
        res = x + y
        print('The result is ' + str(res))
    again = input('Do u want to try again? Y/N ')
    if again == 'N' or 'n':
        break
    
    
Tom Carrick
  • 6,349
  • 13
  • 54
  • 78

1 Answers1

0

Look, you are using the wrong syntax for checking the condition. Use this syntax :

if again=='N' or again=='n':
    break