Homework
Notes
- boolean operators produce booleans after it is used between 2 values
- relational operators work between any two values of the same type
- they are known as operands
- they can work on strings, lists, and other data types
- logical operators work on operands to produce boolean results.
- we can use them in any order as long as the computer recognizes it.
def BinaryConvert(number):
## recursive code
if number >= 1:
BinaryConvert(number // 2) ##based on the power of 2, it will shift the 0 or 1 right
print(number % 2, end = '') ## the end function prevents it from printing a new line --> binary output is only one line.
# Driver Code
number = 31
BinaryConvert(number)