Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!ecngs!feeder2.ecngs.de!newsfeed.freenet.ag!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.000 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'elif': 0.04; '(even': 0.05; '---------': 0.05; 'much!': 0.05; 'badly': 0.07; 'false,': 0.07; 'ok.': 0.07; 'over,': 0.07; 'referring': 0.07; 'subject:help': 0.07; '"but': 0.09; '"yes"': 0.09; '")': 0.09; "'n'": 0.09; '[1,': 0.09; 'agree,': 0.09; 'answering': 0.09; 'be:': 0.09; 'correct,': 0.09; 'item,': 0.09; 'url:github': 0.09; 'cc:addr:python-list': 0.10; 'assume': 0.11; 'value.': 0.15; '"2"': 0.16; '"2":': 0.16; '"=="': 0.16; '"n"': 0.16; '"while"': 0.16; '"y")': 0.16; '"but': 0.16; '1):': 0.16; '2):': 0.16; '3):': 0.16; 'advice:': 0.16; 'already,': 0.16; 'better):': 0.16; 'boolean': 0.16; 'cares': 0.16; 'confusion': 0.16; 'eval': 0.16; 'fine.': 0.16; 'hint': 0.16; 'saver': 0.16; 'say.': 0.16; 'sense,': 0.16; 'set:': 0.16; 'such,': 0.16; 'trivia': 0.16; 'twice.': 0.16; 'typo.': 0.16; '\xa0this': 0.16; 'later': 0.16; 'wrote:': 0.17; 'figures': 0.17; 'skip': 0.17; 'changes': 0.20; 'followed': 0.20; 'question.': 0.20; 'sort': 0.21; 'all,': 0.21; 'meant': 0.21; 'assumes': 0.22; 'combination': 0.22; 'finally,': 0.22; 'planet': 0.22; '\xa0if': 0.22; 'cc:2**0': 0.23; 'errors': 0.23; 'sets': 0.23; 'somebody': 0.23; 'statement': 0.23; "i've": 0.23; 'second': 0.24; 'cc:addr:python.org': 0.25; 'header:In- Reply-To:1': 0.25; 'skip:[ 10': 0.26; 'select': 0.26; 'question': 0.27; 'functions.': 0.27; 'message-id:@mail.gmail.com': 0.27; 'regular': 0.27; "doesn't": 0.28; 'lines': 0.28; 'this?': 0.28; 'run': 0.28; 'post': 0.28; 'sensible': 0.29; 'thus,': 0.29; 'types.': 0.29; 'skip:& 10': 0.29; 'probably': 0.29; "i'm": 0.29; 'normally': 0.30; 'unlike': 0.30; 'button': 0.30; 'figure': 0.30; 'seconds': 0.30; 'stuff': 0.30; 'up.': 0.31; 'code': 0.31; 'gets': 0.32; 'december': 0.32; 'generally': 0.32; 'good.': 0.32; 'skip:- 10': 0.32; 'could': 0.32; 'anywhere': 0.33; 'choices': 0.33; 'defining': 0.33; 'int': 0.33; 'mixed': 0.33; 'much.': 0.33; 'true.': 0.33; 'problem': 0.33; 'knowledge': 0.33; 'code:': 0.33; 'skip:& 20': 0.33; 'that,': 0.34; "can't": 0.34; 'changed': 0.34; 'received:google.com': 0.34; 'done': 0.34; '8bit%:10': 0.69; 'business': 0.70; '3-4': 0.71; 'death': 0.71; 'products.': 0.74; '10%': 0.81; '$50': 0.84; '(customer': 0.84; '(total': 0.84; 'basically,': 0.84; 'deserves': 0.84; 'here!': 0.84; 'movie,': 0.84; 'ordered.': 0.84; 'start.': 0.84; 'thing,': 0.84; 'true!': 0.84; 'wars': 0.84; 'your:': 0.84; '\xa0but': 0.84; 'shopping': 0.87; 'subject:you': 0.88; 'discount': 0.89; 'customer:': 0.91; 'does?': 0.91; 'shopping?': 0.91; 'imagine': 0.96 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=phJIlbjMefW11lrRhc72qZLRTWRvAzqeEcatvs2OBps=; b=weI+Bs4/ePXCNVDbJCErEQtcEbtR3pyALIgSDldWIfMcDEZTBsR6lLnun+HRGG8bV5 hHLEDs4h44HSHo8ii8omVvrAmpRCEuKssn3WfUu6xRD+gjZLz8r6ynnGTabIhDt4831b NnSOeuc4zS2FFeyOOCEEykeYc3IJ+HGRrh36dGo+DhF9nL66QZ2epfR8R9499lLw/Ucx orLFPEgJMk5SEOywo7gNXtesZfIxGpy4JQzLW2MnqZeu4Ta2RKdk+0JA/3bMmRxKgIea 1NECtdlbWKwf7Bm0aFf6wIn74z7whtg7V1bM8sg4cywasaiiPOA9TkTDMgVmIqyFoFHX JUvg== MIME-Version: 1.0 In-Reply-To: <7333128a-6866-4e3c-8436-d5b2397beadc@googlegroups.com> References: <7333128a-6866-4e3c-8436-d5b2397beadc@googlegroups.com> From: Joshua Landau Date: Wed, 26 Dec 2012 23:57:39 +0000 Subject: Re: Please help if you can! To: bobflipperdoodle@gmail.com Content-Type: multipart/alternative; boundary=047d7b66f3298055e804d1ca3412 Cc: python-list X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 906 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1356566309 news.xs4all.nl 6989 [2001:888:2000:d::a6]:51546 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:35552 --047d7b66f3298055e804d1ca3412 Content-Type: text/plain; charset=ISO-8859-1 THIS IS A LONG POST, BUT IF YOU WANT TO LEARN YOU SHOULD READ IT. SERIOUSLY. UNLIKE Mitya Sirenef's THIS DOES NOT ASSUME MORE KNOWLEDGE THAN IS IN YOUR POST ALREADY, ALTHOUGH HIS IS DEFINITELY BETTER OVERALL. AS SUCH, THERE ARE NO FUNCTIONS. OK. There are several small errors in here, but there's nothing too large or worth much worry. On 26 December 2012 21:40, wrote: > I really hope you can help! > > I need to create a program where the user can order any combination and > quantity of 3 products. I then offer a 10% discount if the customer > correctly answers a trivia question. After that, there are 3 choices for > shipping. > > I have most of the program completed but I'm struggling with the most > important parts :/ I get the total of multiple orders of the same item, > but we can't figure out how to total the entire order - before discounts > and shipping - and then where to put any code referring back to the trivia > question. Can somebody please help me with this? I would really appreciate > it! > You write that you "need" to do this, which may hint that this is some sort of homework. If so, it's generally a nice thing to say as much. That said, as long as you've given a good shot at it it's normally fine. > This is the code: > My *very first* thought about this code is that it's really badly spaced. Don't put lines together so much! [https://gist.github.com/4383950] shows how much nicer things look when they're partitioned more. You may not agree, but it took about 10 seconds and I prefer it. > shop_again = 'y' > Hold on! Hold on! shop_again should have a True/False value. It is screaming to be a boolean. "y" is a letter, not a boolean. Thus: shop_again = True This is important because you don't really want to get confused with all your types. What if shop_again was later changed to be True when a button was clicked. Why on earth would you set it to "y"? You'd set it to True. Thus, the sensible option is to have your types right from the very start. print("Welcome to the Star Wars Shop!") > customer = eval(input("Is there a customer in line? (1 = yes, 2 = no)> ")) > eval(input(TEXT)) is a *bad* idea. First of all, eval is really dangerous. Answer "yes" instead and it'll just crash. Answer True and it'll run... BUT do *neither* the if or the elif! That's *bad*. Secondly, you don't need it. Your: "if(customer == 1)" could be "if(customer == '1')", which would work without the eval. And then you've got the standard of "Y/N". So a better question would be: customer = input("Is there a customer in line? [Y/N]> ") Finally, you want to accept "Y" *and* "y", so you'd really want: customer = input("Is there a customer in line? [Y/N]> ").lower() --------- customer = input("Is there a customer in line? [Y/N]> ").lower() Because customer really deserves to be boolean [True/False], you'd want to change it immediately. customer = (customer == "y") This second line assumes that all non-"y"s are False, but that's a folly you'll have to live with for now. while shop_again == 'y': > If you've changed shop_again to be boolean: while shop_again: Some people don't get how this line would make sense. But it does. The "while" statement only cares if it's value it gets is "truthy". Here are lots of truthy things: "y" == "y" True False == False not False "egg loaf" [1, 2, 1, False, False] and here are some falsy things: "n" == "y" False True == False not True "" [] If this makes no sense, please just say. if (customer == 2): > Again, if you've done my changes from above: if not customer: > print("Welcome to the Star Wars Memorabilia Shop!") > customer = eval(input("Is there a customer in line? (1 = yes, 2 = > no)> ")) > Again: customer = input("Is there a customer in line? [Y/N]> ").lower() customer = (customer == "y") BUT HOLD ON! Run your program and then answer "2" twice. What happens? It's not good. The problem is that answering "2" to this second one doesn't skip the loop! x = ASK LOOP: if not x: ASK if x: STUFF MORE STUFF Where you want: x = ASK LOOP: if not x: ASK if x: STUFF MORE STUFF or (even better): while not x: x = ASK LOOP: STUFF MORE STUFF The second is what I've just decided to call the "ask-until-yes" model. Basically, you ask until you get a "yes", so you don't have to put the loop anywhere else. By the time the first loop is over, you *know* that x is True! elif (customer == 1): > Again, if you've done my changes from above: elif customer: > print("Please select an item to update your order and any other > number to check out.") > print("Yoda Figure: $10 each.") > print("Star Wars Movie DVD: $20 each.") > print("Death Star Lego Set: $200 each.") > print(" 1 for Yoda Figure") > print(" 2 for Star Wars Movie DVD") > print(" 3 for Death Star Lego Set") > order = eval(input("Order: ")) > Again: order = input("Order number: ") > if (order == 1): If you've followed my advice: if order == "1": > yoda = eval(input("How many Yoda Figures do you want? : ")) total = 10 * yoda Ooookkay. Now you're thinking: "BUT *surely* I need eval here!!(?)". You don't. yoda = int(input("How many Yoda Figures do you want? : ")) This is better because there are so many problems with eval, and int also means that you can only order whole numbers of yodas. You probably also want to call this "number_of_yodas", because you're not defining what "yoda" is. > print("Total:", total) print("Current order:", yoda, "at", total) if (order == 2): If you've followed my advice: if order == "2": > movie = eval(input("How many Star Wars Movie DVDs do you want? : > ")) total = 20 * movie As above: number_of_movies = int(input("How many Star Wars Movie DVDs do you want? : ")) total = 20 * number_of_movies print("Total:", total) print("Current order:", movie, "at", total) if (order == 3): If you've followed my advice: if order == "3": > legos = eval(input("How many Death Star Lego Sets do you want? : > ")) total = 200 * legos As above: number_of_legos = int(input("How many Death Star Lego Sets do you want? : ")) total = 20 * number_of_legos > print("Total:", total) print("Current order:", legos, "at", total) > shop_again = input("Would you like to keep shopping? 'Y' for yes, 'N' > for no: ") Again: shop_again = input("Would you like to keep shopping? [Y/N]> ").lower() shop_again = (shop_again == "y") > print() print("Your order before shipping and discounts: ",total) print() print("Answer a trivia question for a discount!") discount = eval(input("On what planet did Yoda live when Luke Skywalker > first met him? 1) Earth 2) Dagobah 3) Pluto :")) Again: discount = input("On what planet did Yoda live when Luke Skywalker first met him? 1) Earth 2) Dagobah 3) Pluto :") if (discount == 1): print("Sorry, that answer was wrong!") if (discount == 2): print("That's correct, you get a 10% discount!") if (discount == 3): print("Sorry, that answer was wrong!") If you've taken my advice: if discount == "1": print("Sorry, that answer was wrong!") if discount == "2": print("That's correct, you get a 10% discount!") if discount == "3": print("Sorry, that answer was wrong!") > print() if (discount == 2): If you've taken my advice: if discount == "2": > (total * .9) Hold on! What do you think this line does? What is it meant to do? You meant: total = total*.9 Which for clarity should be written: total = total * 0.9 > print("Your total before shipping: ",total) print("1) Regular Shipping: 3-4 business days, $5.00 per $50 ordered. 2) > Express Shipping: overnight, $10 per $50 ordered. 3) Super Saver Shipping: > 7-10 business days, free.") shipping = eval(input("Please select the shipping method you want: ")) Again: shipping = input("Please select the shipping method you want: ") if (shipping == 1): If you've taken my advice: if shipping == "1": > total == total % 50 total == total * 5 Eeek! Almost! 1) You've mixed up "==" and "=". Look them up if this was a confusion thing, but I imagine it was a subconscious typo. But then what? You've set total to the cost of shipping! What you want is: shipping = total % 50 shipping = shipping * 5 total = total + shipping 2) %?? You mean "//". Look them up. Now. "542353 % 50" makes 3! "542353 // 50" makes 10847, which is what you want. So: shipping = total // 50 shipping = shipping * 5 total = total + shipping print("Your total is: ",total) if (shipping == 2): If you've taken my advice: if shipping == "2": > total == total/50 total == total % 50 total == total * 10 See above, twice. > print("Your total is: ",total) if(shipping == 3): If you've taken my advice: if shipping == "3": > print("Your total is: ",total) print() print("Thanks for shopping here! Please come again!") --047d7b66f3298055e804d1ca3412 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
THIS IS A LONG POST, BUT IF YOU WANT TO LEARN YOU SHO= ULD READ IT. SERIOUSLY.

UNLIKE Mitya Sirenef's= THIS DOES NOT ASSUME MORE KNOWLEDGE THAN IS IN YOUR POST ALREADY, ALTHOUGH= HIS IS=A0DEFINITELY=A0BETTER OVERALL. AS SUCH, THERE ARE NO FUNCTIONS.

OK. There are several small errors in here, but there's = nothing too large or worth much worry.

On 26 December 2012 21:40,=A0<= ;bobflipper= doodle@gmail.com>=A0wrote:
I really hope you can help!

I need to create a prog= ram where the user can order any combination and quantity of 3 products. I = then offer a 10% discount if the customer correctly answers a trivia questi= on. =A0After that, there are 3 choices for shipping.

I have most of the program completed but I'm struggling with the mo= st important parts :/ =A0I get the total of multiple orders of the same ite= m, but we can't figure out how to total the entire order - before disco= unts and shipping - and then where to put any code referring back to the tr= ivia question. Can somebody please help me with this? I would really apprec= iate it!

You write that you "need" to do = this, which may hint that this is some sort of homework. If so, it's ge= nerally a nice thing to say as much. That said, as long as you've given= a good shot at it it's normally fine.
=A0
This is the code:

<= /div>
My *very first* thought about this code is that it's really badly = spaced. Don't put lines together so much! [https://gist.github.com/4383950] shows how much nicer t= hings look when they're partitioned more. You may not agree, but it too= k about 10 seconds and I prefer it.
=A0
shop_again =3D 'y'
<= div>
Hold on! Hold on!
shop_again should have a True/Fa= lse value. It is screaming to be a boolean. "y" is a letter, not = a boolean. Thus:

shop_again =3D True

This is important because you don't really want to get confu= sed with all your types. What if shop_again was later changed to be True wh= en a button was clicked. Why on earth would you set it to "y"? Yo= u'd set it to True. Thus, the sensible option is to have your types rig= ht from the very start.

print("Welcome to the Star Wars Shop!&= quot;)
customer =3D eval(input("Is there a customer in line? (1 =3D yes, 2 = =3D no)> "))

eval(input(TEXT)) = is a *bad* idea.

First of all, eval is really dang= erous. Answer "yes" instead and it'll just crash. Answer True= and it'll run... BUT do *neither* the if or the elif! That's *bad*= .
Secondly, you don't need it. Your:

"= if(customer =3D=3D 1)" could be "if(customer =3D=3D '1')&= quot;, which would work without the eval.

And then= you've got the standard of "Y/N". So a better question would= be:

customer =3D input("Is there a customer in line? [= Y/N]> ")

Finally, you want to accept "= ;Y" *and* "y", so you'd really want:

customer =3D input("Is there a customer in line? [Y/N]> "= ).lower()

---------
customer =3D inp= ut("Is there a customer in line? [Y/N]> ").lower()
Because customer really deserves to be boolean [True/False], you'd want= to change it immediately.

customer =3D (customer = =3D=3D "y")

This second line assumes tha= t all non-"y"s are False, but that's a folly you'll have = to live with for now.

while shop_again =3D=3D 'y':

If you've changed shop_again to be boolean:

while shop_again:
=A0
Some people don= 't get how this line would make sense. But it does. The "while&quo= t; statement only cares if it's value it gets is "truthy". He= re are lots of truthy things:

"y" =3D=3D "y"
True
=
False =3D=3D False
not False
"egg loaf"<= /div>
[1, 2, 1, False, False]

and here are som= e falsy things:

"n" =3D=3D "y"
False
True =3D=3D False
not True
""
[]

If this makes no sense, please just say.
=

=A0 =A0 if (customer =3D=3D 2):
=

Again, if you've done my changes from above:
<= br>
if not customer:
=A0
=A0 =A0 =A0 =A0 print("Welcome to the Star Wars Memorabilia Shop!"= ;)
=A0 =A0 =A0 =A0 customer =3D eval(input("Is there a customer in = line? (1 =3D yes, 2 =3D no)> "))

Again:

customer =3D input("Is there a customer in line? [Y/N]&= gt; ").lower()
customer =3D (customer =3D=3D "y&quo= t;)
=A0
BUT HOLD ON!

Run y= our program and then answer "2" twice. What happens? It's not= good.

The problem is that answering "2" to this sec= ond one doesn't skip the loop!

x =3D ASK
=
LOOP:
=A0 =A0 if not x:
=A0 =A0 =A0 =A0 ASK
<= div>=A0 =A0 if x:
=A0 =A0 =A0 =A0 STUFF
=A0 =A0 MORE STUFF

Where you want:

x =3D ASK
LOO= P:
=A0 =A0 if not x:
=A0 =A0 =A0 =A0 ASK
=A0 = =A0 if x:
=A0 =A0 =A0 =A0 STUFF
=A0 =A0 =A0 =A0 MORE STUFF

or (even bet= ter):

while not x:
=A0 =A0 x =3D ASK
LOOP:
=A0 =A0 STUFF
=A0 =A0 MORE STUFF

The second is what I've just decided to call the "= ask-until-yes" model. Basically, you ask until you get a "yes&quo= t;, so you don't have to put the loop anywhere else. By the time the fi= rst loop is over, you *know* that x is True!

=A0 =A0 elif (customer =3D=3D 1):

Again, if you've done my changes from above:

elif customer:
=A0
=A0 =A0 =A0 =A0 print("Please select an item to update your order and = any other number to check out.")
=A0 =A0 =A0 =A0 print("Yoda F= igure: $10 each.")
=A0 =A0 =A0 =A0 print("Star Wars Movie DVD:= $20 each.")
=A0 =A0 =A0 =A0 print("Death Star Lego Set: $200 each.")
=A0 = =A0 =A0 =A0 print(" 1 for Yoda Figure")
=A0 =A0 =A0 =A0 print(= " 2 for Star Wars Movie DVD")
=A0 =A0 =A0 =A0 print(" 3 f= or Death Star Lego Set")
=A0 =A0 order =3D eval(input("Order: "))
Again:

order =3D input("Order num= ber: ")
=A0
=A0 =A0 if (order =3D=3D 1):

If you've = followed my advice:

if order =3D=3D "1":=
=A0
=A0 =A0 =A0 =A0 yoda =3D eval(input("How many Yoda Figures do you want= ? : "))
=A0 =A0 =A0 =A0 total =3D 10 * yoda

Ooookka= y. Now you're thinking: "BUT *surely* I need eval here!!(?)".=

You don't.

yoda =3D = int(input("How many Yoda Figures do you want? : "))

This is better because there are so many problems with = eval, and int also means that you can only order whole numbers of yodas.
You probably also want to call this "number_of_yodas", be= cause you're not defining what "yoda" is.
=A0
=A0 =A0 =A0 =A0 print("Total:", to= tal)
=A0 =A0 =A0 =A0 print("Current order:", yoda, &q= uot;at", total)
=A0 =A0 if (order =3D=3D 2):

If you've followed my advice:

if order =3D=3D = "2":
=A0
=A0 =A0 =A0 =A0 movie =3D eval(input("How many Star Wars Movie DVDs do= you want? : "))
=A0 =A0 =A0 =A0 total =3D 20 * movie

As abo= ve:

number_of_movies =3D int(input("How many = Star Wars Movie DVDs do you want? : "))
total =3D 20 * n= umber_of_movies=A0

=A0 =A0 =A0 =A0 print("Total:", t= otal)
=A0 =A0 =A0 =A0 print("Current order:", movie, &= quot;at", total)
=A0 =A0 if (order =3D=3D 3):

If you've followed my advice:

if order =3D=3D = "3":
=A0
=A0 =A0 =A0 =A0 legos =3D eval(input("How many Death Star Lego Sets do= you want? : "))
=A0 =A0 =A0 =A0 total =3D 200 * legos

= As above:

number_of_legos =3D int(input("How = many Death Star Lego Sets do you want? : "))
total =3D 2= 0 * number_of_legos
=A0
=A0 =A0 =A0 =A0 print("Total:&quo= t;, total)
=A0 =A0 =A0 =A0 print("Current order:", legos, &= quot;at", total)

=A0 =A0 shop_again =3D input("Would you like to keep shopping? 'Y&= #39; for yes, 'N' for no: ")

A= gain:

shop_again =3D input("Would you like to= keep shopping? [Y/N]> ").lower()
shop_again =3D (shop_again =3D=3D "y")
=A0
=A0 =A0 print()
print("Your order before = shipping and discounts: ",total)
print()
print("Answer a trivia question for a discount!")
discount =3D eval(input("On what planet did Yoda live when Luke Skywal= ker first met him? 1) Earth 2) Dagobah 3) Pluto :"))
=
Again:

discount =3D input("On = what planet did Yoda live when Luke Skywalker first met him? 1) Earth 2) Da= gobah 3) Pluto :")

if (discount =3D=3D 1):
=A0 =A0 print("Sorry, that answer was wrong!") if (discount =3D=3D 2):
=A0 =A0 print("Th= at's correct, you get a 10% discount!")
if (discount =3D=3D 3):
=A0 =A0 print("Sorry, that answer was wrong!")=A0

If you've taken my advice:

= =A0if discount =3D=3D "1":
=A0 =A0 print("Sorry, t= hat answer was wrong!")
if discount =3D=3D "2":
=A0 =A0 print("That&#= 39;s correct, you get a 10% discount!")
if discount =3D=3D &= quot;3":
=A0 =A0 print("Sorry, that answer was wrong!&q= uot;)=A0
=A0
print()
if (discount =3D=3D 2):

If you've taken= my advice:

if discount =3D=3D "2":<= br>
=A0
=A0 =A0 (total * .9)

Hold on! What do you t= hink this line does? What is it meant to do?

You m= eant:

total =3D total*.9

= Which for clarity should be written:

total =3D total * 0.9
=A0
=A0 =A0 print("Your total before shipping: ",total)=A0
=A0
print("1) Regular Shipping: 3-4 busin= ess days, $5.00 per $50 ordered. 2) Express Shipping: overnight, $10 per $5= 0 ordered. 3) Super Saver Shipping: 7-10 business days, free.")
shipping =3D eval(input("Please select the shipping m= ethod you want: "))

Again:
shipping =3D input("Please select= the shipping method you want: ")

if (shipping =3D=3D 1):

If you've = taken my advice:

if shipping =3D=3D "1&qu= ot;:
=A0
=A0 =A0 total =3D=3D total % 50
=A0 =A0 total = =3D=3D total * 5

Eeek! Almost!

1) You've mi= xed up "=3D=3D" and "=3D".

Loo= k them up if this was a confusion thing, but I imagine it was a=A0subconsci= ous=A0typo.

But then what? You've set total to the cost o= f shipping! What you want is:

shipping =3D to= tal % 50
shipping =3D shipping * 5
total =3D total + sh= ipping

2) %?? You mean "//". Look them up. Now= .

"542353 % 50" makes 3!
"= ;542353 // 50" makes 10847, which is what you want.

So:

shipping =3D total // 50
shipping =3D shipping * 5
total =3D total + shipping

=A0 =A0 print("Your total is: ",total)
if (shipping =3D=3D 2):

If you've taken my advice:

<= /div>
if shipping =3D=3D "2":
=A0
=A0 =A0 total =3D=3D total/50
=A0 =A0 total = =3D=3D total % 50
=A0 =A0 total =3D=3D total * 10

See above, twice.
=A0
=A0 =A0 print("Your total is: ",to= tal)
if(shipping =3D=3D 3):

If you've taken my advice:

if shipping =3D=3D "3":
=A0
=A0 =A0 print("Your total is: ",total)
print()
print("Thanks for shopping here! Please come again!&q= uot;)
--047d7b66f3298055e804d1ca3412--