Answer the question
In order to leave comments, you need to log in
Why does print output function at 0x instead of a value?
Here is the code:
def win():
for x in r['lifeTimeStats']:
if x.get('key') == 'Wins':
return x.get('value')
break
def kill():
for c in r['lifeTimeStats']:
if c.get('key') == 'Kills':
return c.get('value')
break
def winrate():
for v in r['lifeTimeStats']:
if v.get('key') == 'Win%':
return v.get('value')
break
def kd():
for b in r['lifeTimeStats']:
if b.get('key') == 'K/d':
return b.get('value')
break
qwerty = input('Нажмите ENTER, чтобы начать.')
while qwerty != 'Назад':
ni = input('Ник игрока: ')
pl = input('Платформа: ')
response = requests.get(
'https://api.fortnitetracker.com/v1/profile/' + pl + '/' + ni,
headers= {'TRN-Api-Key':TRN}
)
r = response.json()
print('\nВот статистика ' + ni)
print('\nПобеды - ', win, '\nУбийства - ', kill, '\nПроцент побед', winrate, '\nK/D - ', kd)
qwerty = input('Чтобы выйти, введи "Назад".\n')
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question