Hello I keep getting an error message on my Python code, that "int is not callable"
Hello everyone,
Please take a look at my code below; let me know where I went wrong.
Thanks
# This program requests the number of packages bought.
# Then it calculates the discount based on the stipulation.
# And then the program displays the discount amount, and
# the total amount after the discount.
# Define the "main" function
def main():
# Declaration
RETAIL_PRICE = 99
quantity_
discounts = 0
sub_total = 0
total_discount = 0
total = 0
# Call on the sub-functions
quantity_
discounts()
sub_
total_
total(
print_SDT()
# Define the "Input_quantity" function
def Input_quantity():
#Get the quantity of purchased packages from user
quantity_
return quantity_purchased
# Define the "" function
def discounts():
# Calculate the discounts
if quantity_purchased < 10:
discount = 0 # No discount
elif 10 <= quantity_purchased and quantity_purchased < 20:
discount = 0.1 # 10% off
elif 20 <= quantity_purchased and quantity_purchased < 50:
discount = 0.2 # 20% off
elif 50 <= quantity_purchased and quantity_purchased < 100:
discount = 0.3 # 30% off
else:
discount = 0.4 # 40% off
# Define the "sub-total" function
def sub_total (REATIL_PRICE, quantity_
sub_total = RETAIL_PRICE * quantity_purchased
# Define the "total_discount" function
def total_discount(
total_discount = sub_total * discount
# Define the "total" function
def total(sub_total, total_discount):
total = sub_total - total_discount
Question information
- Language:
- English Edit question
- Status:
- Answered
- For:
- SikuliX Edit question
- Assignee:
- No assignee Edit question
- Last query:
- Last reply:
Can you help with this problem?
Provide an answer of your own, or ask chukwuka ihemaguba for more information if necessary.