课程:
Microsoft: DEV236x
Introduction to Python: Absolute Beginner
课时:
Final Required Code
习题:
Program: adding_report() function
This program calls the adding_report() function which repeatedly takes positive integer input until the user quits and then sums the integers and prints a “report”.
The adding_report() function has 1 string parameter which indicates the type of report:
“A” used as the argument to adding_report() results in printing of all of the input integers and the total
“T” used as the argument results in printing only the total
Sample input and output:
call adding_report() with “A” as argument (print all the integers entered and the total)
Input an integer to add to the total or “Q” to quit
Enter an integer or “Q”: 3
Enter an integer or “Q”: 6
Enter an integer or “Q”: 24
Enter an integer or “Q”: 17
Enter an integer or “Q”: 61
Enter a