This is my code for print: "url = ("https://etherscan.io/address/%s"address)"
and i got SyntaxError: invalid syntax
My Python version is 3.7 and i'm new to python I think %s is the problem, i'm not what replacement of that in Python 3.7
This is my code for print: "url = ("https://etherscan.io/address/%s"address)"
and i got SyntaxError: invalid syntax
My Python version is 3.7 and i'm new to python I think %s is the problem, i'm not what replacement of that in Python 3.7
url = ("https://etherscan.io/address/%s" % address)
^
You're missing the % to assign the variable. Alternatively you can use other forms of string formatting:
Using .format()
url = "https://etherscan.io/address/{}".format(address)
Using f
strings:
url = f"https://etherscan.io/address/{address}"