If/Else


To implement this situation with the help of Python we can use the next code:
123456# What year did the first computer appear? i = 1927 if i == 1927: print('You are right!') else: print('You are not right!')
Now we will implement if/else
to find updated prices (with different discounts) for the subscriptions.
Swipe to start coding
Analysts decided to update subscription prices.
They want to set a 25%
discount if the price
is higher than 25
. In other cases, they want to set a 10%
discount.
- Set the condition if the
price
is greater than25
. - Set the
25%
discount if theprice
is greater than25
.!
- Otherwise, set the
10%
discount. - Print the
price_upd
.
!
To set the 25%
discount use value * 0.75
Рішення
Дякуємо за ваш відгук!
single
Запитати АІ
Запитати АІ
Запитайте про що завгодно або спробуйте одне із запропонованих запитань, щоб почати наш чат
Awesome!
Completion rate improved to 2.08
If/Else
Свайпніть щоб показати меню


To implement this situation with the help of Python we can use the next code:
123456# What year did the first computer appear? i = 1927 if i == 1927: print('You are right!') else: print('You are not right!')
Now we will implement if/else
to find updated prices (with different discounts) for the subscriptions.
Swipe to start coding
Analysts decided to update subscription prices.
They want to set a 25%
discount if the price
is higher than 25
. In other cases, they want to set a 10%
discount.
- Set the condition if the
price
is greater than25
. - Set the
25%
discount if theprice
is greater than25
.!
- Otherwise, set the
10%
discount. - Print the
price_upd
.
!
To set the 25%
discount use value * 0.75
Рішення
Дякуємо за ваш відгук!
Awesome!
Completion rate improved to 2.08single