Kategorie: Wszystkie - variables - comparison - operators - syntax

przez Юмаева Эльмира 3 lat temu

276

Условный оператор в Python

Условный оператор в Python

Условный оператор в Python

Type in your name.

Логический тип данных

Type in the things you don't like.

Простые выражения
Переменные
Величины

Условия

if

Type in your dream job.

Синтаксис оператора

Выбор

Ин

Type in an important thing people should know about you.

Иначе
Если

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

Type in the things you like.

!=
==
>=
<=
=
>
<

Операторы break и continue

Type in the personality traits you have.

Оператор цикла while

a = 0 while a < 7: print("A") a += 1

Type in your eye color.

Варианты использования

Конструкция if – elif – else

Type in your nationality.

a = int(input("введите число:")) if a < 0: print("Neg") elif a == 0: print("Zero") else: print("Pos")
Конструкция if – else

Type in your birthdate.

a = 3 if a > 2: print("H") else: print("L")
Конструкция if

Type in your age.

if 1: print("hello 1")