0

What happens is that when I hit the enter key to break the loop, it will count me breaking the loop as an output. Example 1. Guest Name 2. Guest Name 3. < (Hit the enter key to activate break command) This is my code.

1 Answers1

0

Put if block just after input command in for loop.

for iii in range(1, 1000):
    guests = input("....")
    if guests.lower() == "":
        break
    output = output + str(iii) + "." +guests
Mohit Sharma
  • 590
  • 3
  • 10