New to python (and coding in general) and was hoping for some help understanding this.
Here's some sample code from Ipify:
from requests import get
ip = get('https://api.ipify.org').text
print('My public IP address is: {}'.format(ip))
I don't really understand how the braces are working in second line, but I've tried writing it a few other ways that I understand instead:
ip = get('https://api.ipify.org').text
print(f"my public IP is {ip}")
and
ip = get('https://api.ipify.org').text
print("my public IP is", ip)
My question is how is the code they provided in the first example better and what are the braces doing in their code?
Thanks in advance for any help.