mercredi 20 mai 2020

Need help solving this problem in Python. Write a program that reads in two files: a template and a database

Junk mail. Write a program that reads in two files: a template and a database. The template file contains text and tags. The tags have the form |1| |2| |3|… and need to be replaced with the first, second, third, … field in the current database record. A typical database looks like this: Mr.|Harry|Morgan|1105 Torre Ave.|Cupertino|CA|95014 Dr.|John|Lee|702 Ninth Street Apt. 4|San Jose|CA|95109 Miss|Evelyn|Garcia|1101 S. University Place|Ann Arbor|MI|48105 And here is a typical form letter: To: |1| |2| |3| |4| |5|, |6| |7| Dear |1| |3|: You and the |3| family may be the lucky winners of $10,000,000 in the Python clearinghouse sweepstakes!

Aucun commentaire:

Enregistrer un commentaire