Extend the form-letter recipe to take an input of a pet’s name and type, and reference the pet in the form letter."Your pet "+petType+","+petName+" will love our offer!" might generate "Your pet poodle, Fifi, will love our offer!".

What will be an ideal response?

Note: The answer just needs to include one extra line with the suggested changes.

```
def formLetter(gender,lastName,city,eyeColor, petType, petName):
file = open("formLetter.txt","wt")
file.write("Dear ")
if gender=="F":
file.write("Ms. "+lastName+":\n")
if gender=="M":
file.write("Mr. "+lastName+":\n")
file.write("I am writing to remind you of the offer ")
file.write("that we sent to you last week. Everyone in ")
file.write(city+" knows what an exceptional offer this is!")
file.write("(Especially those with lovely eyes of"+eyeColor+"!)")
file.write("Your pet "+petType+", "+petName+" will love our offer!")
file.write("We hope to hear from you soon.\n")
file.write("Sincerely ,\n")
file.write("I.M. Acrook , Attorney at Law")
file.close()
```

Computer Science & Information Technology

You might also like to view...

It is not possible to use keywords to search for themes.

Answer the following statement true (T) or false (F)

Computer Science & Information Technology

You can apply a chart type to an existing data series in a chart to create a(n) ____ chart.

A. nested B. combination C. complex D. exploded

Computer Science & Information Technology