https://pastebin.com/9RhzE024
Нещо недоглеждам. Ако може някой да погледне. New House от 23.02. 90/100.
Нещо недоглеждам. Ако може някой да погледне. New House от 23.02. 90/100.
Здравей! Това е моето решение:
flower_type = input()
flower_number = int(input())
budjet = int(input())
price = 0.0
if flower_type == 'Roses':
price = 5 * flower_number
if flower_number > 80:
price -=0.1*price
elif flower_type == 'Dahlias':
price = 3.8 * flower_number
if flower_number > 90:
price -= 0.15 * price
elif flower_type == 'Tulips':
price = 2.8 * flower_number
if flower_number > 80:
price -=0.15*price
elif flower_type == 'Narcissus':
price = 3 * flower_number
if flower_number < 120:
price +=0.15*price
elif flower_type == 'Gladiolus':
price = 2.5 * flower_number
if flower_number < 80:
price +=0.2*price
diff = abs(budjet-price)
if budjet >= price:
print(f'Hey, you have a great garden with {flower_number} {flower_type} and {diff:.2f} leva left.')
else:
print (f'Not enough money, you need {diff:.2f} leva more.')
Мисля, че проблемът е при пресмятането на цените с discount при отделните видове цветя.
if flower_type == 'Roses':
flower_price = flowers_count * 5
if flowers_count > 80:
flower_price /= 1.1 тук е проблема. Това не е същото като 10% намаление. Направи го като другите flower_price -= flower_price * 0.10 и трябва да е окей.
Поздрави
Благодаря.Става!
Ок много благодаря