Предмет: Информатика, автор: sugbimerzhalieva

напишите конструкцию условного оператора в Python....​

Ответы

Автор ответа: TomasSmZRs
0

# if <условие 1>:

# <блок 1>

# elif <условие 2>:

# <блок 2>

# elif <условие n>:

# <блок n>

# else:

# <блок_n+1>

# /sample/

cost = 10_000

if cost <= 1000:

print('No dicount')

elif cost <= 3000:

print('Discount 10%')

elif cost <= 5000:

print('Discount 20%')

else:

print('Discount 30%')

# Comparison operators:

# == ; != ; < ; > ; <= ; >=

# Logical operators:

# and ; or ; not

# /sample/

weak_passwords = ['qwerty', 'password', 'user123', 'abcabc']

password = input('password: ')

if len(password) < 5 or password in weak_passwords:

print('Your password is too weak!')

Приложения:
Похожие вопросы
Предмет: Українська мова, автор: Барби08