Question: (PYTHON) Objectives: Use tuples and lists Format a form letter Document your program Paste the console output to the bottom of your source code file
(PYTHON)
Objectives:
Use tuples and lists
Format a form letter
Document your program
Paste the console output to the bottom of your source code file to submit in Canvas
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Write a program that will print form letters asking for votes in the upcoming election. Here is an example of output that your finished program will produce:
Dear Hildegard, I would like you to vote for Hillary Clinton because I think Hillary Clinton is best for this country. Sincerely, Brunhilda
Dear Cheech, I would like you to vote for Donald Trump because I think Donald Trump is best for this country. Sincerely, Chong
Create a string containing the unchanging part of the letter, use " " for end of lines, and use "%s" as the placehoder for each of the variable parts of the letter.
Create a tuple for each letter. The tuple will contain 3 strings: addressee, candidate, sender. Because you will have a number of slightly different letters, you will need a list of these tuples, i.e. put these tuples into a list.
There will be no input from the keyboard for this assignment, all data will be hardcoded in your program. Your program must output 3 letters that differ only in the addressee, candidate and sender.
In order to receive full credit, your program must:
use both lists and tuples,
print the output in the format used in the sample letters above,
have a comment as the first line that tells what the program does.
follow all program guidelines
Challenge: Read any number of names of the addressee, candidate and sender from the user at the keyboard. Your program must repeatedly prompt the user and read all three strings, until the user indicates that she is finished. Only after the user had typed in ALL strings for ALL letters, your program then prints all the letters. If you succeed in implementing this challenge, please submit just your solution to the challenge and not the solution to the basic assignment.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
