Question: Please finish the python code. use as much comments as possible. i am having a lot of trouble. Finish the following code by: Creating a

Please finish the python code. use as much comments as possible. i am having a lot of trouble.

Please finish the python code. use as much comments as possible. i

Finish the following code by:

Creating a display so that you list the total number of astronauts Printing the total number of spacecrafts Printing each spacecraft and the astronauts assigned to it (use a loop) Add demographic data (by searching for it) to your retrieved data regarding each astronaut's: gender, country of origin, and age (add to dictionary or list or tuple that you've created) Print out this information also.

You should have something like:

>>>

Welcome to ....

This program does ....

-----------------------------------

There are ___ number of spacecrafts active.

There are ___ number of astronauts.

Some Spacecraft Astronaut #1 Male USA 45 Astronaut #2 Female Russia 51 Some Spacecraft Astronaut #1 Female Australia 45

Include comments!

1#1 /usr/bin/env python3 2# -*-coding: utf-8 -*- 4 Created on Thu Oct 19 11:04:15 2017 6 Purpose: Create an app that provides us with information about astronauts currently in space 9 @author: someone 10 " 11# import libraries 12 import requests 13 14# initiate dictionary 15 data th 16 17 # Get the response from the API endpoint. 18 responserequests.get("http://api.open-notify.org/astros.json") 19 20 # Return the JSON formatted information to our data dictionary 21 data -response.json() 23 # output the data in a friendly way 24 print("In Welcome to the Astronaut in Space tool. ") 25 print("\t With this tool, you will receive information about all" + 27 26 28# here we output the information for our users 29 # print|data1 "the astronauts currently in space.n")

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!