#booleans_example_1.py

## Booleans are a type of variable that has only two values :  True or False
##
## Boolean values can be set and used in the ways shown below:

my_bool = ( 4 > 6)   # this will set my_bool to False
print("my_bool was set to ", my_bool, "by \"my_bool = (4 > 6)\"")

## note how this is used in the following code:

val1 = 200
val2 = 300
is_greater = (val1 > val2)
if (is_greater): print("\n",val1, " is greater than ",val2)
else: print("\n",val1, " is not greater than ", val2)

print("\n\nExamples using setting my_bool to True or False\n")
my_bool = True
if (my_bool) :
    print("if statement shows my_bool is True")
else:
    print("if staftement shows my bool is False")
print("\nprinting my_bool gives :  ",my_bool
      
#
# note:  booleans can be converted to strings if desired.
)
#my_bool_str = str(my_bool)
#print("after converting to a string, my_bool becomes ",my_bool_str)
print("\n")


my_bool = False

if (my_bool) :
    print("if statement shows my_bool is True")
else:
    print("if statement shows my bool is False")
print("\nprinting my_bool gives :  ",my_bool)

## note the difference between the above code and the code below
print("\n\nSame code using strings rather than booleans\m")

my_bool_str  = "True"
print("my_bool is ",my_bool)

if (my_bool_str == "True") :
    print("my_bool is True")
else:
    print("my bool is False")
print("\n")



my_bool_str = "False"
print("my_bool is ",my_bool)

if (my_bool_str == "True") :
    print("my_bool is True")
else:
    print("my bool is False")
