Jun-17-2018, 11:42 PM
def adding_report(report = "T"): total = 0 numbers = "\nItems\n" while True: int_or_q = input("Enter an integer, or 'Q' to quit: ") if int_or_q.isdigit(): total += int(int_or_q) if report.startswith("A"): numbers += int_or_q + "\n" elif int_or_q.startswith("Q"): if report.startswith("A"): print(numbers + "\nTotal\n" + str(total)) else: print("\nTotal\n" + str(total)) break if report.startswith("T"): print("\nTotal\n" + str(total)) else: print(int_or_q, "is an invalid input, try again!") break adding_report(int_or_q) print() adding_report("T") adding_report("A")Didn't notice that typo, fixed it! Thank you. It's not running again now for some reason, and I have no idea why. I called the function and fixed the syntax errors from before, but when I try to run the code (provided above) it won't run at all, it just jumps to the next cell.