Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Вивчайте What is a Boolean Data Type? | Boolean Type
Python Data Types

bookWhat is a Boolean Data Type?

It's time to move to the Boolean data type. Variables that are Boolean data types can take the following values: either False or True.

Keywords False and True are capitalized, if we write lowercase we will get an error.

Input:
a = True
print(type(a))

b = False
print(type(b))

Output:
<class 'bool'>
<class 'bool'>
Input:
x = 15 > -5
print(x)
print(type(x))

Output:
True
<class 'bool'>
Input:
y = 17 < 4
print(y)
print(type(y))

Output:
False
<class 'bool'>

In Python, data types such as Boolean and integer are very interrelated, namely the default Boolean value False is represented by an integer 0, and Boolean value True is represented by an integer 1.

Завдання

Swipe to start coding

You have to fill in the blanks so that all expressions will be True.

Рішення

Все було зрозуміло?

Як ми можемо покращити це?

Дякуємо за ваш відгук!

Секція 2. Розділ 1
single

single

Запитати АІ

expand

Запитати АІ

ChatGPT

Запитайте про що завгодно або спробуйте одне із запропонованих запитань, щоб почати наш чат

Suggested prompts:

Сумаризуйте цей розділ

Пояснити код у file

Пояснити, чому file не вирішує завдання

close

Awesome!

Completion rate improved to 3.85

bookWhat is a Boolean Data Type?

Свайпніть щоб показати меню

It's time to move to the Boolean data type. Variables that are Boolean data types can take the following values: either False or True.

Keywords False and True are capitalized, if we write lowercase we will get an error.

Input:
a = True
print(type(a))

b = False
print(type(b))

Output:
<class 'bool'>
<class 'bool'>
Input:
x = 15 > -5
print(x)
print(type(x))

Output:
True
<class 'bool'>
Input:
y = 17 < 4
print(y)
print(type(y))

Output:
False
<class 'bool'>

In Python, data types such as Boolean and integer are very interrelated, namely the default Boolean value False is represented by an integer 0, and Boolean value True is represented by an integer 1.

Завдання

Swipe to start coding

You have to fill in the blanks so that all expressions will be True.

Рішення

Switch to desktopПерейдіть на комп'ютер для реальної практикиПродовжуйте з того місця, де ви зупинились, використовуючи один з наведених нижче варіантів
Все було зрозуміло?

Як ми можемо покращити це?

Дякуємо за ваш відгук!

close

Awesome!

Completion rate improved to 3.85
Секція 2. Розділ 1
single

single

some-alt