From the course: Python for JavaScript Developers
Unlock the full course today
Join today to access over 22,500 courses taught by industry experts or purchase this course individually.
Challenge: Map to comprehension - Python Tutorial
From the course: Python for JavaScript Developers
Challenge: Map to comprehension
(bouncy electronic music) - [Instructor] Earlier in the course, we discussed some of the advantages of knowing Python as well as JavaScript. In particular it's great to be able to make decisions about where logic belongs in your application stack. Let's put that into practice with this next challenge. So here I am in my exercise files in a folder called ch_05_05 in a file called app.py. And at the top of the file I bring in some modules. I imported json, which is a module for dealing with JSON data in the Python language. Then I bring in Decimal and I make some imports from the Flask micro web framework. Then on line seven, I instantiate a Flask application which is standard boilerplate when working with Flask. Lines nine and 10 bring in some data from a file called laureate.json. This is data about Nobel prize winners made available by nobelprize.org. And we store that in a variable called nobel_prize_laureates.…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
-
-
(Locked)
Iterating in Python3m 46s
-
(Locked)
Writing concise code with zip and enumerate3m 39s
-
(Locked)
From JavaScript map and filter to an elegant Python comprehensions6m 2s
-
(Locked)
Decorators are essential3m 35s
-
(Locked)
Challenge: Map to comprehension5m 19s
-
(Locked)
Solution: Map to comprehension2m 32s
-
(Locked)
-