Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

(PYTHON) Objectives: Use tuples and lists Format a form letter Document your pro

ID: 3590385 • Letter: #

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 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:


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.

Explanation / Answer

# This program demnstarte use of list and tuple and print letter to be send to voters for presidential election for different candidate

letter = "Dear %s, I would like you to vote for %s because I think %s is best for this country. Sincerely, %s"

letter1 = ("Hildegard", "Hilary Clinton", "Hilary Clinton", "Brunhilda")

letter2 = ("Cheech", "Donald Trump", "Donald Trump", "Chong")
letter3 = ("Amanda", "Donald Trump", "Donald Trump", "Ben")

tuple_list = [letter1, letter2, letter3]

for content in tuple_list:
print(letter % content)

# code link: https://paste.ee/p/SQuhq

Sample output

Please rate positively.

I assumed your homework don't need challaenge part as assignment clearly inidcate you need hardcoded values.