I have two variables: balance and payment. If the user writes a negative value, I ask the question again. Problem: in the while loop, when the user inserts a positive value, it still prints the while statement as well as the else statement. I want it to print while statement only when the value is 0 or less than zero. The rest of the code is working fine.
balance = 0 payment = 0 while balance <= 0: balance = int(input('What is your balance?:')) print('Kindly insert value again') # problem in this line else: print('your balance is',balance) while payment <= 0: payment = int(input('How much would you like to save?:')) print('kindly write a positive value') else: print("your payment is ", payment) numpay = balance/payment print(numpay)