So, I want this code to have user input Dogechain address, and I get the balance of that address. When I execute this I get error:
url = "https://dogechain.info/api/v1/address/balance/"+ a
Error:
TypeError: cannot concatenate 'str' and 'int' objects
Code:
import requests
def main():
a = input("Address?")
url = "https://dogechain.info/api/v1/address/balance/"+ a
response = requests.get(url)
bal = response.json()[0]["balance"]
print("Balance:",bal)
main()
or
And @Ryan O'Donnell's comment below explains why, thanks.