Uploaded by Graham Goldman

python assignment

advertisement
Problem 1
Write a program with a loop that asks the user to enter a series of positive numbers. The user
should enter a negative number to signal the end of the series. After all the positive numbers
have been entered, the program should display the sum.
Problem 2
At one college, the tuition for a full-time student is $8,000 per semester. It has been announced
that the tuition will increase by 3 percent each year for the next 5 years. Write a program with a
loop that displays the projected semester tuition for the next 5 years.
Problem 3
Write a program that uses a nested loops to draw this pattern:
*******
******
*****
****
***
**
*
Problem 4
Write a program that prints out all numbers from list_a: [0,1,2,3,4,5] that do not have a
corresponding number in another list_b: [1,3,5,7,9]. When a number in list_a is determined to
not have a duplicate in list_b, print out "{num} is not in list_b".
For example: "0 is not in list_b"
Submission Instructions
Submit your assignment in a single python file (ex. assignment5.py)
IMPORTANT
You will notice there are problems that don't require programming solutions. Please just enter
those answers as comments in your python file (each line is preceded with '#'). For anything that
requires coded programmatic solution, you can simple append them to the file one after the
other. If you need to test your programs, feel free to only consolidate your solutions into one file
for submission AFTER you've completed each problem.
Submit file using WebcamWebcam
Submit file using FilesFiles
Submit file using Google AppsGoogle Apps
Submit file using Microsoft Office 365Microsoft Office 365
Download