Sal's Shipping -- solution video "pass in", "%", ".2f"

Hi:

In Sal’s Shipping tutorial video, in the final function it coded:

print(
“The cheapest option available is $%.2f with %s shipping.”
% (cost, method)
)

Up until this point in the Python lessons, I don’t remember learning this “passing in” method using “%” (nor the float decimal thing) and I was wondering if someone could point me to some resources that could help me understand this. I tried googling, but I honestly don’t know what I need to search for.

Thanks y’all.

https://pyformat.info/

I’m not sure if it covers f-string, yet, but it does cover the other string formatting methods.

2 Likes

Thank you for the resource, sir!

1 Like