Python Programming - Data Types - Discussion

Discussion Forum : Data Types - General Questions (Q.No. 53)
53.
What is the purpose of the bool() function?
Converts a string to a boolean
Checks if a variable is of type boolean
Converts a number to a boolean
Creates a boolean variable with a specified value
Answer: Option
Explanation:
The bool() function can be used to convert a number to a boolean. 0 becomes False, and any non-zero value becomes True.
Discussion:
Be the first person to comment on this question !

Post your comments here:

Your comments will be displayed after verification.