From 9465db68156e94ed98b763fe53910e46030d873b Mon Sep 17 00:00:00 2001 From: Chris Virostko Date: Fri, 12 Oct 2018 13:18:52 -0600 Subject: [PATCH] challenge1 completed --- subdirchris/chrischallenge.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 subdirchris/chrischallenge.py diff --git a/subdirchris/chrischallenge.py b/subdirchris/chrischallenge.py new file mode 100644 index 0000000..b4402c8 --- /dev/null +++ b/subdirchris/chrischallenge.py @@ -0,0 +1,13 @@ +import requests +import json +import swapi + +ships = swapi.get_all("starships") + +for ship in ships.iter(): + if ship.pilots: + print(ship.name) + for pilots in ship.pilots: + jason = requests.get(pilots) + data = jason.json() + print(' '+data['name'].encode('utf-8'))