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

Challenge: Map to comprehension - Python Tutorial

From the course: Python for JavaScript Developers

Start my 1-month free trial

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.…

Contents