Get startedGet started for free

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.

This exercise is part of the course

Regular Expressions in Python

View Course

Hands-on interactive exercise

Have a go at this exercise by completing this sample code.

# Import template
from string import Template

# Complete template string using identifiers
the_answers = ____("Check your answer 1: ____, and your answer 2: ____")
Edit and Run Code