This file contains 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 os | |
import requests | |
import json | |
def main(): | |
members = get_members_data() | |
parties = group_members_by_party(members) | |
dems = parties[0] | |
reps = parties[1] | |
#print(json.dumps(reps, indent=4)) |
This file contains 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 os | |
import requests | |
import json | |
def main(): | |
members = get_members_data() | |
grouped_members = group_members_by_party(members) | |
sort_member = sort_member(grouped_members) | |
print(json.dumps(members, indent=4)) |
This file contains 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 os | |
import requests | |
import json | |
def main(): | |
data = get_members_data() | |
for members in data['results'][0]['members']: | |
print(members) | |
grouped_members = group_members_by_party(members) |
This file contains 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
animals = ['cat', 'dog', 'canary', 'chihuahua', 'narwhal'] | |
filtered_animals = [] | |
number = 0 | |
for animal in animals: | |
if (animal[0]) == "c": | |
filtered_animals.append(animal.upper()) | |
number = number + 1 | |
print(filtered_animals, "Number of C-animals: ", number) |
This file contains 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
#!/bin/bash | |
# Silence the output of curl and write the results to specified file | |
curl -s --output banklist.csv https://www.fdic.gov/resources/resolutions/bank-failures/failed-bank-list/banklist.csv | |
# TODO: create ca_failed_banks.csv | |
# It must have the same header row as the original file (banklist.csv) | |
# Check out exercises/bash_drill.md (in this GitHub repo online) | |
# for pointers on getting the first line of a file | |
# and redirecting the content to a new file. |