0

The while loop below does not break when I input "no" Code:

def information():
    name = input("What is your name?: ")
    bid = input("what is your bid?: ")
    auction_dict = {
                    }
    bidders = input("Are there any other bidders? Type 'yes' or 'no'.")
    while bidders == "yes": 
        clear()    
        information()
        if bidders == "no":
            break
    print("Loop ended")     
        
   
information()



When I input "no" after typing "yes" the loop continues. However, if I type "no" before typing "yes" the while loop while break and print.

  • 2
    because you are calling the same function again inside of the for loop you will have recursion. There is never an update to the bidders value inside of the while loop so it will always continue – Andrew Ryan Dec 16 '22 at 03:08

0 Answers0