15 lines
533 B
Python
15 lines
533 B
Python
"""
|
|
Full disclosure, prior to attempting this, I actually looked at the link
|
|
at the top of page 51, and even visited it. I also relied heavily on w3schools
|
|
compared to the textbook. While initially learning Python, I found the language
|
|
of the book difficult, but as I grasped concepts, it came easier.
|
|
"""
|
|
|
|
def is_even(k):
|
|
if k & 2 != 10: # I first thought to compare the var to an even number
|
|
print(False)
|
|
else:
|
|
print(True)
|
|
|
|
print('Is "k" an even number?')
|
|
is_even(int(input('Give a value for k: '))) |