You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The code uses the Pokémon API to fetch data for a list of 6 Pokémon IDs. For each ID, it retrieves the Pokémon's information including name, height, and weight, and writes this data to a file named 'pokemon.txt'.
"""
import requests
def write_data(id):
"""
Fetches data for a Pokémon ID from the Pokémon API and writes it to a file.
Args:
id (int): The ID of the Pokémon to fetch and write to file.