Shipping Program

Hello, I have run into an issue where my output for shipping charge needs to be Real
Use local named constants not global
Also the package weight needs to be times the rate PER pound, is what I have correct?

rate1= 1.1
rate2= 2.2
rate3= 3.7
rate4= 3.8

def main():
   packageWeight = float(input( "What is the weight of the package?"))
   shipping_Weight(packageWeight)

def shipping_Weight(packageWeight):
    if packageWeight <= 2:
       Weight = rate1 * packageWeight
       print ("The total shipping charge is $: " , Weight)

        elif packageWeight <= 6:
            Weight = rate2 * packageWeight
            print ("The total shipping charge is $: " , Weight)

        elif packageWeight <= 10:
            Weight = rate3 * packageWeight
            print ("The total shipping charge is $: " , Weight)

        elif packageWeight > 10:
            Weight = rate4 * packageWeight
            print ("The total shipping charge is $: " , Weight)

main()

Top 10 Humor APIs

There is nothing funny about Application Programming Interfaces (APIs), usually, but we've rounded up a few to chuckle over. Developers wanting to add some humor to their applications can start with this list of the top ten Humor APIs from the ProgrammableWeb directory.

How can I restart my code, from inside my code?

Hi,

I am fairly new to the community, and have recently began to code using python, however, I am stuck on something:

I have written quite a length of code, and am using the 'if' command, and I am attempting to restart the code if they type 'yes'. It would look something like this:

if restart == "Yes":
(restart program here?!?)

I know to some, this is an incredibly easy thing to do, but I have tried multiple different solutions, none of them working. (I even tried examples from the internet - same outcome. They just restart the shell, or don't work at all.)

I have previously considered using a loop too, however, this doesn't seem to work either?? I am happy to take both restarting methods and loops, if they work.

If anybody has any information on how this is possible, please tell me!

I am using IDLE Python 3.6.4 32-bit (Incase you may need that)

Thank You!!