Integers - 3.2.1

# Declaring Integers
# They can be any length, long or short
DogAge = 99
CatAge = 101
seconds_alive = 109020390

# Arithmetic Operations
print("DogAge", DogAge)
print("CatAge", CatAge)
print("-"*50)
print("Arithmetic Operations:")
print("DogAge + CatAge =", DogAge + CatAge) #addition
print("DogAge - CatAge =", DogAge - CatAge) #subtraction
print("DogAge * CatAge =", DogAge * CatAge) #multiplication
print("DogAge/CatAge =", DogAge/CatAge) #division
print("DogAge^CatAge =", DogAge ** CatAge) #exponentiation
print("-"*50)

# Counting
print("Counting:")
for i in range(10):
    print(f"Dog Age + {i} =", DogAge + i)

# Integers are abstractions since they simplify the concept of positive and or negative by creating a single datatype for both
# Integers also abstractions as they simplify the process of performing mathematical operations as you can do it with a single datatype
DogAge 99
CatAge 101
--------------------------------------------------
Arithmetic Operations:
DogAge + CatAge = 200
DogAge - CatAge = -2
DogAge * CatAge = 9999
DogAge/CatAge = 0.9801980198019802
DogAge^CatAge = 3623720178604972098813098663067922123278149558725344544918977989723238743032175007053245780749266808966549534096463148419710533398337814216985343009467904985311514465603728812874382843771759324099510099
--------------------------------------------------
Counting:
Dog Age + 0 = 99
Dog Age + 1 = 100
Dog Age + 2 = 101
Dog Age + 3 = 102
Dog Age + 4 = 103
Dog Age + 5 = 104
Dog Age + 6 = 105
Dog Age + 7 = 106
Dog Age + 8 = 107
Dog Age + 9 = 108

Javascript Version

%%js
let DogAge = 99;
let CatAge = 101;
let seconds_alive = 109020390;

// Arithmetic Operations
console.log("DogAge", DogAge);
console.log("CatAge", CatAge);
console.log("-".repeat(50));
console.log("Arithmetic Operations:");
console.log("DogAge + CatAge =", DogAge + CatAge); // addition
console.log("DogAge - CatAge =", DogAge - CatAge); // subtraction
console.log("DogAge * CatAge =", DogAge * CatAge); // multiplication
console.log("DogAge / CatAge =", DogAge / CatAge); // division
console.log("DogAge^CatAge =", Math.pow(DogAge, CatAge)); // exponentiation
console.log("-".repeat(50));

// Counting
console.log("Counting:");
for (let i = 0; i < 10; i++) {
    console.log(`Dog Age + ${i} =`, DogAge + i);
}

See the Pen on CodePen.