Aan de slagGa gratis aan de slag

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.

Deze oefening maakt deel uit van de cursus

Regular Expressions in Python

Cursus bekijken

Praktische interactieve oefening

Probeer deze oefening eens door deze voorbeeldcode in te vullen.

# Import template
from string import Template

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