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

What is indentations... ?

6 Votes

Application RAM usage

1 Votes

Showing errors!

2 Votes

About Java McQ

0 Votes

Q. Anna is 18 years old

-2 Votes

int num = 2;
int x = 3;
if(num >= 2) {
if(x > 4) { num = 3; }
else { num = 4; }
}
else {x = 1; }

1 Votes

Balconies Problem in C

0 Votes