Adding attributes

Report a typo

Assume that you pass such context to a template:

post = {'author': 'John Doe', 'text': 'Great'}

For this time, use if-else statements to render the correct content to a page. You should add the text of a post to a div element only if a post has an author. If the post does not have an author, the content of an element should be empty.

Write a program in Python 3
template = """
<html>
<div>{{ }} {{ }}</div>
</html>
"""

Create a free account to access the full topic