Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Converting: bool() | Bring All the Topics Together
Data Types in Python
course content

Course Content

Data Types in Python

Data Types in Python

1. Getting Familiar With Numbers in Python
2. True or False?
3. Strings
4. Bring All the Topics Together

bookConverting: 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 except 0 in different types (0, 0.0), and None will lead to True.

Task

You have three values here: -90, None, and "La vie est belle". Put them into the bool() function (replace ___) to make True_statement1,True_statement2 equal True, and False_statement1 equal False.

Switch to desktopSwitch to desktop for real-world practiceContinue from where you are using one of the options below
Everything was clear?

How can we improve it?

Thanks for your feedback!

Section 4. Chapter 4
toggle bottom row

bookConverting: 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 except 0 in different types (0, 0.0), and None will lead to True.

Task

You have three values here: -90, None, and "La vie est belle". Put them into the bool() function (replace ___) to make True_statement1,True_statement2 equal True, and False_statement1 equal False.

Switch to desktopSwitch to desktop for real-world practiceContinue from where you are using one of the options below
Everything was clear?

How can we improve it?

Thanks for your feedback!

Section 4. Chapter 4
toggle bottom row

bookConverting: 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 except 0 in different types (0, 0.0), and None will lead to True.

Task

You have three values here: -90, None, and "La vie est belle". Put them into the bool() function (replace ___) to make True_statement1,True_statement2 equal True, and False_statement1 equal False.

Switch to desktopSwitch to desktop for real-world practiceContinue from where you are using one of the options below
Everything was clear?

How can we improve it?

Thanks for your feedback!

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 except 0 in different types (0, 0.0), and None will lead to True.

Task

You have three values here: -90, None, and "La vie est belle". Put them into the bool() function (replace ___) to make True_statement1,True_statement2 equal True, and False_statement1 equal False.

Switch to desktopSwitch to desktop for real-world practiceContinue from where you are using one of the options below
Section 4. Chapter 4
Switch to desktopSwitch to desktop for real-world practiceContinue from where you are using one of the options below
some-alt