Can someone code this different for me

python

#1

<PLEASE USE THE FOLLOWING TEMPLATE TO HELP YOU CREATE A GREAT POST!>

<Below this line, add a link to the EXACT exercise that you are stuck at.>

book_title = "Software Development for Begginers"
price_per_book = float(x = 15.99)
print("The book title is", book_title)
print("Each book costs", price_per_book)
book_ordered = int(input("How many book have you ordered? >>"))
min = 1
max = 80

while book_ordered < min or book_ordered > max:
    print("Enter a number between", min, "and", max, "please.")
    print("Try again")
    book_ordered = int(input(">>"))

if book_ordered >= 51 and book_ordered <= 80:
    print("By ordering", book_ordered, "books you have 10% discount")
    discounted_books = (price_per_book * book_ordered) / 10 * 9
    print("The price for the books is £", (round(discounted_books, 2)))

elif book_ordered >= 11 and book_ordered <= 50:    
    print("By ordering", book_ordered, "books, you have 7.5% discount")
    discounted_books = (price_per_book * book_ordered) / 40 * 37
    print("The price for the books is £", (round(discounted_books, 2))) 

elif book_ordered >= 5 and book_ordered <= 10:
    print("By ordering", book_ordered, "books, you have 5% discount")
    discounted_books = (price_per_book * book_ordered) / 20 * 19
    print("The price for the books is £", (round(discounted_books, 2)))
#discount the cost
else:
    discounted_books = price_per_book * book_ordered
    print("The price for the books is £", (round(discounted_books, 2)))
#adding a voucher
print("Do you have a voucher?")
print("YES or NO")
voucher = str(input("-->"))
off = 25
#if you have a voucher £25 off
if voucher == "yes" or voucher == "YES" or voucher == "Yes":
    price = (discounted_books - off)
    print("Your total price is £", (round(price, 2)))

else:
    print("Your total price is £", (round(discounted_books, 2)))

<In what way does your code behave incorrectly? Include ALL error messages.>
i just want the same code but diffrent coded thanks

<What do you expect to happen instead?>

```python

Replace this line with your code.

<do not remove the three backticks above>

#3

I hate to break it to you, but we are not going to sit here and rewrite your entire program for you, as that’s not our job; It’s yours. Now, we can help you rewrite it, by answering questions you may have or clearing up confusion about a coding concept, etc. But, ultimately you still have to be the one to do it. Otherwise, how would you learn anything?


#6

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