Помогите решить задачу, пожалуйста! | Sololearn: Learn to code for FREE!
¡Nuevo curso! ¡Todo programador debería aprender IA Generativa!
Prueba una lección gratuita
+ 1

Помогите решить задачу, пожалуйста!

Your favorite store is having a sale! You pay full price for the most expensive item that you get, but then you get 30% off of everything else in your purchase! How much are you going to save? Sales tax is 7%. Also, you leave anything below a dollar in your saving as a tip to the seller. If your saving is a round amount, you don't leave any tips. https://code.sololearn.com/cnpkkTTeu1Jk/?ref=app

29th Dec 2022, 11:43 AM
Ruzik73
3 Respuestas
+ 1
2 changes you need : 1) tovar = tovar.split(",") max = max(tovar) here tover values are string types stil. So first you need to convert float type then find max. Otherwise it return maximum string. Not maximum float value. 2) you are missing to include tax 7% on result. try round-up ceil the result of sum values... Hope it works fine.. edit: 2 изменения, которые вам нужны: 1) товар = товар.split(",") max = max(tovar) здесь товер значения по-прежнему являются строковыми типами. Итак, сначала вам нужно преобразовать тип float, а затем найти max. В противном случае он возвращает максимальную строку. Не максимальное плавающее значение. 2) вы не включили налог 7% на результат. попробуйте округлить результат суммирования значений... Надеюсь нормально работает..
29th Dec 2022, 12:09 PM
Jayakrishna 🇮🇳
+ 2
Спасибо!!! Tovar исправила, 7% дейсвительно забыла! Сейчас попроьуб
29th Dec 2022, 12:11 PM
Ruzik73
+ 2
Бинго! Спасибо большое за помощь, все получилось!)))
29th Dec 2022, 12:22 PM
Ruzik73