def adding_report(choose): total = 0 lista = [] print("Enter an integer to add to the total or Quit.") while True: if choose == "A": numb = input('Enter an integer or "Q": ') if numb.isdigit(): total = total + int(numb) lista.append(numb) elif numb.startswith("Q"): print("Items") print(lista) print("Total") print(total) else: print("Invalid input!") if choose == "T": numb = input('Enter an integer or "Q": ') if numb.isdigit(): total = total + int(numb) elif numb.startswith("Q"): print("Total") print(total) else: print("Invalid input!") adding_report(input("Choose report type(A or T): "))edit: Change made, now it works fine!
Final problem
Messages In This Thread |
Final problem - by Truman - Jan-21-2018, 12:02 AM
RE: Final problem - by j.crater - Jan-21-2018, 12:14 AM
RE: Final problem - by Truman - Jan-21-2018, 11:17 PM
RE: Final problem - by j.crater - Jan-22-2018, 07:08 AM
RE: Final problem - by Truman - Jan-22-2018, 11:42 PM
|
Possibly Related Threads… | |||||
Thread | Author | Replies | Views | Last Post | |
![]() |
Final Projet - Credit Risk | Rauchvant | 3 | 3,239 |
Nov-18-2020, 03:21 PM Last Post: Rauchvant |
Help needed, stuck at the final output | extricate | 0 | 2,036 |
Jun-20-2020, 05:35 AM Last Post: extricate |
|
Final Project (Databases, GUI, and Classes) | poochenthecreator | 1 | 2,504 |
Apr-27-2020, 09:58 PM Last Post: deanhystad |
|
Final Project Help | hyg71886 | 6 | 5,383 |
Feb-07-2019, 01:30 AM Last Post: micseydel |
|
Trouble with edX Python Final | sarah_mb_sues | 11 | 16,005 |
Jun-19-2018, 10:36 AM Last Post: cryomick |
Users browsing this thread: 1 Guest(s)