Learn Python 3, Sal's Shipping


I have a question about the syntax in this exercise :

Learn Python 3 | Codecademy

Why is it necessary to add a comma in between $" and cost_drone for the syntax to be correct and where is this information located I didn’t see it Cheatsheets for Learn Python 3

print(“Drone Shipping $” , cost_drone)

print() is a function call. The print function prints the supplied arguments. Like any function, those arguments are separated by commas. You have 2 arguments: a string literal, and a value with the variable cost_drone assigned to it.

1 Like

Ok this makes sense now.
Thank you!

1 Like

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.