0

# Stuggling with Super Sale Challenge

I can't seem to get the hidden test #4 to pass. I have tried both int and floor together and separate. Any suggestions would be much appreciated. import math items = (input()).split(",") items.sort() total = 0 for i in items[:-1]: total += int(i) savings = total * .3 * 1.07 print(int(math.floor(savings)))

5 Answers

+ 2

Try
Items=([float(x) for x in input().split(",")])

+ 2

Try converting to float already during input. Solved the problem for me, though I still don't fully understand it. In my solution I convert to float when calling the element from the list, before any mathematical operations are conducted. But hey, I can find peace now 🥴.
I'd be thankful for any explanation though.
https://code.sololearn.com/cexwZ58s25El/?ref=app

+ 1

I'm stuck with the same problem, I can feel your pain 😁

+ 1

Tried changing the int(i) to a float but no luck with my method. Glad you got it to work for your program. I guess I will have to keep at it.

0

Worked Matthias! Thank you so much. I will have to try and firgure out why it working.

Hot today

Тренажер кода

2 Votes

help my code does not iterate

0 Votes

What's wrong with this??

0 Votes

What is the problem 🤨🧐??

1 Votes

Generador de divicion python.

1 Votes