Sal's shipping

Hello, guys when I run this code I get an error that says cost is not defined. What do I do?

def cheapest_shipping(weight):
ground = ground_shipping(weight)
premium = premium_ground_shipping
drone = drone_shipping(weight)

if ground < premium and ground < drone:
cost = ground
method = “ground”

elif drone < premium and drone < ground:
cost = drone
method = “drone”

else:
cost = premium
method = “premium”
print ("The cheapest option available is $ " + str(cost) + "with " + method)

cheapest_shipping(4.8)

Hello, @code2619873001, and welcome to the forums.

Try editing your post following the guidelines found here, How do I format code in my posts?
As is, we can only guess at how your code was indented originally.

Hello, guys when I run this code I get an error that says cost is not defined. What do I do?

def cheapest_shipping(weight):
ground = ground_shipping(weight)
premium = premium_ground_shipping
drone = drone_shipping(weight)

if ground < premium and ground < drone:
    cost = ground
    method = “ground”

elif drone < premium and drone < ground:
    cost = drone
    method = “drone”

else:
    cost = premium
    method = “premium”
print ("The cheapest option available is $ " + str(cost) + "with " + method)

cheapest_shipping(4.8)

Hello @code2619873001. I think the main issue is the indentation. Since Python works using whitespace, you should check to make sure that all of the code you want in the function cheapest_shipping is indented correctly.