Попробовал сделать так:
import json
import requests
url = 'https://swapi.dev/api'
response = requests.get(url).json()
people_api = response['people']
planets_api = response['planets']
starships_api = response['starships']
def starships(url):
for i in range(0, 4):
response_starships = requests.get(url).json()
print(response_starships['name'][i])
print(response_starships['max_atmosphering_speed'][i])
starships(starships_api)
Вроде должен выводить значения name и max_atmosphering_speed у первых пяти космических кораблей, но не выводит