Conteúdo do Curso
Tipos de Dados em Python
Tipos de Dados em Python
Converting: bool()
This short practical chapter will get us acquainted with the bool()
function. You may recall that numbers can be converted to the boolean data type too: 1
means True
, and 0
means False
.
Note
We can put whatever we want into the
bool()
function, and everything except0
in different types (0
,0.0
), andNone
will lead toTrue
.
Swipe to begin your solution
In this task, you'll practice using the bool()
function to convert different values to boolean.
- Convert
-90
to a boolean and store the result instatement1
. - Convert
"La vie est belle"
to a boolean and store the result instatement2
. - Convert
None
to a boolean and store the result instatement3
.
Solução
Obrigado pelo seu feedback!
Converting: bool()
This short practical chapter will get us acquainted with the bool()
function. You may recall that numbers can be converted to the boolean data type too: 1
means True
, and 0
means False
.
Note
We can put whatever we want into the
bool()
function, and everything except0
in different types (0
,0.0
), andNone
will lead toTrue
.
Swipe to begin your solution
In this task, you'll practice using the bool()
function to convert different values to boolean.
- Convert
-90
to a boolean and store the result instatement1
. - Convert
"La vie est belle"
to a boolean and store the result instatement2
. - Convert
None
to a boolean and store the result instatement3
.
Solução
Obrigado pelo seu feedback!