Вопрос задан 16.06.2023 в 11:50. Предмет Информатика. Спрашивает Маленкова Анна.

Дан фрагмент программы: if cost < 1000: print('Скидка 0%') elif cost < 2000: print('Скидка

2%') elif cost < 5000: print('Скидка 5%') else: print('Скидка 10%') Какую скидку можно будет получить, если стоимость покупки cost = 1999?
0 0
Перейти к ответам

Ответы на вопрос

Внимание! Ответы на вопросы дают живые люди. Они могут содержать ошибочную информацию, заблуждения, а также ответы могут быть сгенерированы нейросетями. Будьте внимательны. Если вы уверены, что ответ неверный, нажмите кнопку "Пожаловаться" под ответом.
Отвечает Репина Маша.

Ответ:

2%

Объяснение:

elif cost < 2000:

print('Скидка 2%')

иначе если стоимость меньше 2000 вывод: скидка 2 процента, у нас стоимость 1999

0 0
Отвечает нейросеть ChatGpt. Будьте внимательны, ответы нейросети могут содержать ошибочные или выдуманные данные.

Calculation of Discount in Python Program

The given Python program calculates the discount based on the cost of a purchase. Let's analyze the program step by step.

```python if cost < 1000: print('Скидка 0%') elif cost < 2000: print('Скидка 2%') elif cost < 5000: print('Скидка 5%') else: print('Скидка 10%') ```

The program uses an `if-elif-else` statement to determine the discount based on the value of the `cost` variable. Here's how it works:

1. If the `cost` is less than 1000, the program will print `'Скидка 0%'`. 2. If the `cost` is between 1000 and 1999 (exclusive), the program will print `'Скидка 2%'`. 3. If the `cost` is between 2000 and 4999 (exclusive), the program will print `'Скидка 5%'`. 4. If the `cost` is 5000 or greater, the program will print `'Скидка 10%'`.

Now, let's calculate the discount for a specific cost of purchase, where `cost = 1999`.

Calculation of Discount for cost = 1999

According to the given program, if the `cost` is less than 1000, the discount is 0%. If the `cost` is between 1000 and 1999, the discount is 2%. Therefore, for `cost = 1999`, the discount will be 2%.

So, the discount that can be obtained for a purchase with a cost of `cost = 1999` is 2%.

Please let me know if you need any further assistance!

0 0

Похожие вопросы

Топ вопросов за вчера в категории Информатика

Последние заданные вопросы в категории Информатика

Задать вопрос