Skip to content

Instantly share code, notes, and snippets.

View saliksyed's full-sized avatar

Salik Syed saliksyed

  • California
View GitHub Profile
# 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
my_dictionary = {
"A": 8,
"B": 2,
"C": 99,
"D": 1,
"E": 99,
"F": None
}
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Created on Thu Jun 29 11:26:56 2017
@author: saliksyed
"""
gdp_data = open("gdp.dat").readlines()
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Created on Thu Jun 29 11:26:56 2017
@author: saliksyed
"""
gdp_data = open("gdp.dat").readlines()
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:]:
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)
#!/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"))
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()
from flask import Flask, make_response
app = Flask(__name__)
import matplotlib.pyplot as plt
def draw_picture():
# Open the file with all the airports and read every line
data = open("airports.dat", "r").readlines()
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Created on Thu Jun 29 11:26:56 2017
@author: saliksyed
"""
import csv
import matplotlib.pyplot as plt