<jupyter_start><jupyter_text>Lab Two---For this lab we're going to get into logicOur Goals are:- Using Conditionals- Using Loops- Creating a Function- Using a Class<jupyter_code># Create an if statement
has_lacrosse_equipment = True
if has_lacrosse_equipment:
    print("I can go play lacrosse.")
# Create an if else statement
has_lacrosse_equipment = True
is_free = False
if has_lacrosse_equipment and is_free:
    print("I can go play lacrosse.")
else:
    print("I can't play lacrosse because I don't have my equipment.")

# Create an if elif else statement
has_lacrosse_equipment = True
is_free = False
has_other_plans = True
if has_lacrosse_equipment and is_free:
    print("I can go play lacrosse because the scenario was true.")
elif has_lacrosse_equipment and has_other_plans:
    print("I can't play lacrosse because I have other plans")
else:
    print("I can't play lacrosse because I don't have my equipment.")
# Create a for loop using range(). Go from 0 to 9. Print out each number.
numbers = ["0","1", "2", "3", "4", "5", "6", "7", "8", "9"]

for item in numbers:
    print(item)
# Create a for loop iterating through this list and printing out the value.
arr = ['Blue', 'Yellow', 'Red', 'Green', 'Purple', 'Magenta', 'Lilac']
for item in arr:
    print(item)
# Get the length of the list above and print it.
for value in range(7):
    print(arr[value])
    print(value)

# Create a while loop that ends after 6 times through. Print something for each pass.
x = 6

while x > 0:
    x -= 1
    if x == 6:
        break
    print(x)
print("Loop ended.")

# Create a function to add 2 numbers together. Print out the number
def addition(input1, input2):
    sum = input1 + input2
    print(input1 + input2)
addition(16, 7)

# Create a function that tells you if a number is odd or even and print the result.
num = int(input("Enter a number: "))
if (num % 2) == 0:
    print("{0} is Even".format(num))
else:
    print("{0} is Odd".format(num))
# Initialize an instance of the following class. Use a variable to store the object and then call the info function to print out the attributes.
class Dog(object):
    def __init__(self, name, height, weight, breed):
        self.name = name
        self.height = height
        self.weight = weight
        self.breed = breed

    def info(self):
        print("Name:", self.name)
        print("Weight:", str(self.weight) + " pounds")
        print("Height:", str(self.height) + " inches")
        print("Breed:", self.breed)

if __name__ == "__main__":
    Soph = Dog("<NAME>", 13, 15, "Yorkiepoo")
    Soph.info()<jupyter_output>Name: <NAME>
Weight: 15 pounds
Height: 13 inches
Breed: Yorkiepoo
{'fraction_non_alphanumeric': 0.11345646437994723, 'fraction_numerical': 0.015077271013946476, 'mean_word_length': 3.5916955017301038, 'pattern_counts': {'":': 1, '<': 6, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '253691', 'license': 'MIT', 'n_tokens_mistral': 891, 'n_tokens_neox': 833, 'n_words': 340, 'path': 'JupyterNotebooks/Labs/Lab 3 - CMPT 120.ipynb', 'repo_name': 'eddiecapone55/CMPT-120L-201-22S', 'size': '2667'}