The bakery has requested the following custom variables:
-customer’s first name
-customer’s last name
-a coupon percentage off
-the date that they became a newsletter subscriber
Create an appropriate variable for each of these four items.
Then create string for the custom newsletter text that will show up before, between, and after each custom variable.
For example, “Hello,” might be the first string, followed by the variable carrying the customer’s name, followed by “Thanks for subscribing to our newsletter!” Your custom newsletter text should greet the person, then offer them a coupon, and then thank them for being a loyal customer.
Add placeholder names and information to populate into the variables for testing purposes by making up data for each. You can use your own name, for example, as this is simply a prototype or proof of concept. To do this, remember that the equals sign = between a variable and its value assigns that value to the variable.
Finally, use the print function to display the final newsletter text that includes all the required variables. This will display a final string that reads like a plaintext newsletter with the variables appropriately replaced by the defaults for each that you set in Step 1.
We can also combine two strings together in a single print function by using the + sign like this:
print(greetingTxt + firstName + bodyTxt1)