-
Notifications
You must be signed in to change notification settings - Fork 0
/
task.html
15 lines (15 loc) · 1.17 KB
/
task.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
<h2>Nested</h2>
<html>
<head></head>
<body>
<p>Imagine, there are three children in a family and they wrote down what they want to be when they grow up:</p>
<pre><code class="language-python">children = {'Emily': 'artist', 'Adam': 'astronaut', 'Nancy': 'programmer'}</code></pre>
<p>Let's say you want to store not only the profession they have chosen, but also their age: Emily is 5, Adam is 9, and Nancy is 14. To do so, you can create nested dictionaries for each key in the outer dictionary.</p>
<p>For each name, create a nested dictionary with the keys <code class="language-python">'profession'</code> and <code class="language-python">'age'</code>, modify the dictionary <code class="language-python">children</code> but don't print it.</p>
<p><strong>NB:</strong> write the age as an integer.</p>
</body>
</html><br><br><font color="gray">Memory limit: 256 MB</font><br><font color="gray">Time limit: 15 seconds</font><br><br>
<b>Caution</b><br><br>
You may see errors in your code or execution results due to missing context. Don’t worry about it, just write the solution and press Check.
<br><br>
<a href="https://hyperskill.org/learn/step/6481">Show topic summary</a>