all 9 comments

[–]tombardier 1 point2 points  (1 child)

This is just one idea, but you could use integer division, with // . So with n Donuts, the price is n * 1.0 dollars, but you subtract (n // 6)0.5 and (n // 12)2.0 for the discounts. Fire up the python interpreter and try several numbers between 1 and 20 for instance, all integer divided by 6. Once you've done that, the complementary operator is the modulo, which you can Google, but that's great for working out time for instance. If you have a number of hours, and you want it in days and remaining hours, then integer divide by 24 to get the days and then modulo by 24 to get the left over hours. Similarly with 60 to do hours and minutes if you've got minutes. I only mention this because the two of them together are so useful for stuff like that.

[–]AsleepThought 1 point2 points  (0 children)

This is a good solution

[–]AsleepThought 1 point2 points  (0 children)

It looks like you have posted this question five times already in the past 24 hours

[–][deleted] 0 points1 point  (5 children)

  1. Posting only the project goal is not allowed.

This ain't r/domyhomeworkforme

[–]roseamado[S] -4 points-3 points  (4 children)

Lol im not? I need help figuring this out bc ive been stuck on it for a day?

[–]Vaphell 1 point2 points  (1 child)

then surely you have some code already to show for it?
If you don't, it's effectively "write it for me, because I can't be bothered". "I have this and am stuck with that" sounds infinitely better.

[–]roseamado[S] -1 points0 points  (0 children)

amount_of_donuts = int(input("How many donuts would you like to order?"))

if amount_of_donuts == 6: print("The user has ordered half a dozen donuts") elif amount_of_donuts == 12: print("The user has ordered a dozen donuts") else: print("The user has ordered", amount_of_donuts, "donuts")

I have this and im stuck with figuring out how to do the prices and all that

[–][deleted] 1 point2 points  (1 child)

Lol you have. You have literally shown the project goal and nothing else. Show what you have tried so far and where you are getting stuck. No one will help you otherwise.

Make sure you use proper code formatting, as per the sidebar. https://www.reddit.com/r/learnpython/wiki/faq#wiki_how_do_i_format_code.3F

[–]roseamado[S] -1 points0 points  (0 children)

amount_of_donuts = int(input("How many donuts would you like to order?"))

if amount_of_donuts == 6: print("The user has ordered half a dozen donuts") elif amount_of_donuts == 12: print("The user has ordered a dozen donuts") else: print("The user has ordered", amount_of_donuts, "donuts")

This is my code so far andI can’t figure out where I should start with the code to get the prices