f'Привет {name}.'
def get_user_albums_by_id(id):
url = f'http://myapi.com/users/{id}/albums'
r = requests.get(url)
return r.json()
https://api.instagram.com/v1/users/self/?access_token=ACCESS-TOKEN
import requests
token = 'MY_TOKEN'
def get_user(user):
params = {
'access_token': token,
'q': user
}
url = 'https://api.instagram.com/v1/users/search'
try:
r = requests.get(url, params=params)
result = r.json()
return result
except:
return Exception
python3 %имяфайла%
f'Мой текст а дальше имя: {name}.'