Data Types

BartC bc at freeuk.com
Wed Sep 21 08:25:47 EDT 2016


On 21/09/2016 05:03, Cai Gengyang wrote:

> Are there any other data types that will give you type(A) or type(B) = <class 'bool'> besides True and False?

No types but any variable or expression containing True or False will be 
a bool type (or class bool):

  A = 10<20
  print (type(A))      =>  <class 'bool'>

  print (10<20)        =>  True

  print (type(10<20))  =>  <class 'bool'>

  --
Bartc



More information about the Python-list mailing list