0
Kaleidoscope challenge
Kaleidoscope Challenge Can anyone help with my code for the kaleidoscope challenge? k=int(input())# number of kaleidoscopes c=5 #cost of kaleidoscopes t=.07 #tax d=.10 #discount if purchasing more than 1 def total(x): #custom variable for the total amount paid if k>1: x=((k*5)*t)-d print(total)
2 Réponses
+ 2
"total" is a function in your code, not a variable. If you want to use it as a function, the function should return a value and you should provide all necessary input data when defining and when calling the function.
0
Try
order = int(input())
if order > 1:
print(round(order*5*0.9*1.07, 2))
else:
print(round(order*5*1.07, 2))