Skip to content

Latest commit

 

History

History
28 lines (19 loc) · 1.07 KB

File metadata and controls

28 lines (19 loc) · 1.07 KB

THURSDAY MORNING CHALLENGE

Introduction to APIs

  1. Copy/paste the dictionary "astro" below into your script. As of 10:39am ET 7/30/20, these are all astronauts currently aboard the International Space Station (ISS)! See for yourself at http://api.open-notify.org/astros.json.
astro= {"message": "success", "number": 5, "people": [{"craft": "ISS", "name": "Chris Cassidy"}, {"craft": "ISS", "name": "Anatoly Ivanishin"}, {"craft": "ISS", "name": "Ivan Vagner"}, {"craft": "ISS", "name": "Doug Hurley"}, {"craft": "ISS", "name": "Bob Behnken"}]}
  1. Write a line that returns how many people are currently aboard the ISS.

  2. Using a FOR LOOP, pull the names of each astronaut and the craft they are currently aboard.

Your final output should look like this:

People in Space: 3

Chris Cassidy is on the ISS
Anatoly Ivanishin is on the ISS
Ivan Vagner is on the ISS
Doug Hurley is on the ISS
Bob Behnken is on the ISS

NO CHEATING! Both the name of the astronaut and the name of the craft (ISS) has to come from the dictionary :)

No, you can't modify the dictionary!