Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Python bool() Function | Boolean Type
Python Data Types
course content

Contenido del Curso

Python Data Types

Python Data Types

1. Numeric Types
2. Boolean Type
3. Strings

Python bool() Function

In Python there is bool() function that converts variables of any type into a variable of boolean type (True or False). Let's look at an example for better understanding.

Any digit other than zero is True.

Tarea

You have three numbers of different numeric types, you have to return a boolean object from each of one.

Tarea

You have three numbers of different numeric types, you have to return a boolean object from each of one.

¿Todo estuvo claro?

Sección 2. Capítulo 2
toggle bottom row

Python bool() Function

In Python there is bool() function that converts variables of any type into a variable of boolean type (True or False). Let's look at an example for better understanding.

Any digit other than zero is True.

Tarea

You have three numbers of different numeric types, you have to return a boolean object from each of one.

Tarea

You have three numbers of different numeric types, you have to return a boolean object from each of one.

¿Todo estuvo claro?

Sección 2. Capítulo 2
toggle bottom row

Python bool() Function

In Python there is bool() function that converts variables of any type into a variable of boolean type (True or False). Let's look at an example for better understanding.

Any digit other than zero is True.

Tarea

You have three numbers of different numeric types, you have to return a boolean object from each of one.

Tarea

You have three numbers of different numeric types, you have to return a boolean object from each of one.

¿Todo estuvo claro?

In Python there is bool() function that converts variables of any type into a variable of boolean type (True or False). Let's look at an example for better understanding.

Any digit other than zero is True.

Tarea

You have three numbers of different numeric types, you have to return a boolean object from each of one.

Sección 2. Capítulo 2
Cambia al escritorio para practicar en el mundo realContinúe desde donde se encuentra utilizando una de las siguientes opciones
We're sorry to hear that something went wrong. What happened?
some-alt