challenge1 completed
This commit is contained in:
parent
69986c034d
commit
9465db6815
13
subdirchris/chrischallenge.py
Normal file
13
subdirchris/chrischallenge.py
Normal file
|
@ -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'))
|
Loading…
Reference in a new issue