Playing safe
You are in charge of a new project! Your job is to start collecting information from the company's main application users. You will make an online quiz and ask your users to voluntarily answer two questions. However, it is not mandatory for the user to answer both. You will be handling user-provided strings so you decide to use the Template method to print the input information. This allows users to double-check their answers before submitting them.
The answer of one user has been stored in the dictionary answers
. You can use the print()
function to view the variables in the IPython Shell.
Diese Übung ist Teil des Kurses
Regular Expressions in Python
Interaktive Übung
Versuche dich an dieser Übung, indem du diesen Beispielcode vervollständigst.
# Import template
from string import Template
# Complete template string using identifiers
the_answers = ____("Check your answer 1: ____, and your answer 2: ____")