Fall 2024 - P2
Big Idea 3 | .1 | .2 | .3 | .4 | .5 | .6 | .7 | .8 | .10 |
3.2 Lesson Period 2 - None Data Abstraction
Student led teaching on Abstraction. Teaching how various data types can use abstraction for copmutational efficiency.
None - 3.2.9
print("x = None")
x = None
# Nones are data abstractions because they represent a nonexistent value for better handling of unspecified data.
print("Output of x:", x)
print("So is x true, or is x false?")
if x:
print("Do you think None is True?")
elif x is False:
print ("Do you think None is False?")
else:
print("None is not True, or False, None is just None...")
x = None
Output of x: None
So is x true, or is x false?
None is not True, or False, None is just None...
Javascript Version
var x = null;
console.log("Output of X", x)
if (x) {
console.log("Do you think null True?");
} else if (x == false) {
console.log("Do you think null is False");
} else {
console.log("Null is not True or False, null is just null...");
}