forked from Anuragcoderealy/Codenewhacktober
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathastronauts.py
More file actions
27 lines (21 loc) · 685 Bytes
/
astronauts.py
File metadata and controls
27 lines (21 loc) · 685 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import requests
import inquirer
r = requests.get("http://api.open-notify.org/astros.json",
headers={"User-Agent": "Hello"})
data = r.json()
astroEmoji = "👨🚀"
astronauts = data["people"]
print(f'There are {data["number"]} astronauts in the space')
for people in astronauts:
print(f'Name: {people["name"]} {astroEmoji}')
print("Hey you! Join us and go in the space!")
confirm = {
inquirer.Confirm('confirmed',
message="Do you want to become an astronaut?",
default=True),
}
confirmation = inquirer.prompt(confirm)
if(confirmation["confirmed"]):
print('Welcome aboard!!!!')
else:
print('Oh no :c')