R-1.2: added comments and r-1.2_scratch.py for tinkering
This commit is contained in:
+8
-1
@@ -1,5 +1,12 @@
|
|||||||
|
"""
|
||||||
|
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):
|
def is_even(k):
|
||||||
if k & 2 != 10:
|
if k & 2 != 10: # I first thought to compare the var to an even number
|
||||||
print(False)
|
print(False)
|
||||||
else:
|
else:
|
||||||
print(True)
|
print(True)
|
||||||
|
|||||||
@@ -0,0 +1,10 @@
|
|||||||
|
#!/usr/bin/env python3
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
"""
|
||||||
|
Created on Wed Sep 2 21:21:46 2026
|
||||||
|
|
||||||
|
@author: joseph
|
||||||
|
"""
|
||||||
|
|
||||||
|
def is_even(k):
|
||||||
|
if k &
|
||||||
Reference in New Issue
Block a user