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)

2nd Aug 2022, 5:04 PM
M Heather Fleming
M Heather Fleming - avatar
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.
2nd Aug 2022, 5:26 PM
Lisa
Lisa - avatar
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))
27th Sep 2022, 3:23 PM
Eugene Teh
Eugene Teh - avatar