This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from flask import Flask, make_response | |
app = Flask(__name__) | |
@app.route("/gdp/<country_code>") | |
def render_chart(country_code): | |
return "<h1>"+country_code+"</h1>" | |
if __name__ == "__main__": | |
app.run() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python2 | |
# -*- coding: utf-8 -*- | |
""" | |
Created on Thu Jun 29 11:26:56 2017 | |
@author: saliksyed | |
""" | |
import csv | |
gdp_data = csv.reader(open("gdp.dat")) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
population_data = csv.reader(open("population.dat","r")) | |
population_by_country_code = {} | |
for row in population_data: | |
country = row[0] | |
country_code = row[1] | |
population_data = [] | |
for value in row[5:]: | |
if value == "": | |
population_data.append(None) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import csv | |
gdp_data = csv.reader(open("gdp.dat")) | |
gdp_by_country_code = {} | |
for row in gdp_data: | |
country = row[0] | |
country_code = row[1] | |
gdp_values = [] | |
for value in row[5:]: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python2 | |
# -*- coding: utf-8 -*- | |
""" | |
Created on Thu Jun 29 11:26:56 2017 | |
@author: saliksyed | |
""" | |
gdp_data = open("gdp.dat").readlines() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python2 | |
# -*- coding: utf-8 -*- | |
""" | |
Created on Thu Jun 29 11:26:56 2017 | |
@author: saliksyed | |
""" | |
gdp_data = open("gdp.dat").readlines() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
my_dictionary = { | |
"A": 8, | |
"B": 2, | |
"C": 99, | |
"D": 1, | |
"E": 99, | |
"F": None | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Python Starter Quiz | |
# Try your best to answer these questions. It’s just an assessment so I can get | |
# a feel for the level of Python skills in the class. No stress and no grade for this :) | |
# Question 1 : | |
# Print out "Coding is awesome :)" | |
# Question 2: | |
# Print the first 50 even numbers greater than 900 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Python Starter Quiz | |
# Try your best to answer these questions. It’s just an assessment so I can get | |
# a feel for the level of Python skills in the class. No stress and no grade for this :) | |
# Question 1 : | |
# Print out “Coding is awesome :)” | |
print "Coding is awesome :)" | |
# Question 2: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Python Starter Quiz | |
# Try your best to answer these questions. It’s just an assessment so I can get | |
# a feel for the level of Python skills in the class. No stress and no grade for this :) | |
# Question 1 : | |
# Print out “Coding is awesome :)” | |
# Question 2: |