Skip to the content.

Sprint Two Personal Blog

Personal Blog about Sprint 2

What I Taught

We taught lesson 3.8 which was iterations

  1. Loops

    -For Loops

    -While Loops

    -Do-While Loops

    -Infinite Loops

  2. Nested-If Statements
  3. Try/Except
  4. Dictionaries

What I learned

Lesson Thing Learned 1 Thing Learned 2 Hacks
Lesson 3.1 Manipulating string data Basic print statements Hack 3.1
Lesson 3.2 Understanding variable scope Data types overview Hack 3.2
Lesson 3.3 Using expressions for calculations Arithmetic operations Hack 3.3
Lesson 3.4 Advanced string manipulation String methods and formatting Hack 3.4
Lesson 3.5 Boolean logic in programming True/False evaluations Hack 3.5
Lesson 3.6 Using conditions to control flow If statements and outcomes Hack 3.6
Lesson 3.7 Complex conditional structures Chaining conditions Hack 3.7
Lesson 3.10 List indexing and slicing Iterating through lists Hack 3.10

Extra Summary of what I learned

Throughout our teaching we learned:

  • Simplify complex concepts then work back to complex. Ex. Popcorn hacks were simple to an extent, but homework hacks combined them all.
  • Every student learns differently, adapt presentation to all. Ex. Popcorn hacks, pictures, examples.
  • Answering questions for students in a way that makes sense
  • Prepare ourselves for the lesson. Ex. Practicing explaining, think about possible questions that could be asked.

Throughout our process of creating the lesson, we learned:

  • Dive deep into Iterations. Since we are teaching this lesson, we need to know everything about it, so the lessons and videos on college board were not going to cut it. We needed to do outside research and research any questions we had.
  • Embracing Mistakes. We made many, many mistakes especially because this was a sort of self-taught lesson. Mr. Mort closed many of our pull requests and we even made the mistake of not testing things locally for one of our pull requests. However, we learned from these and never made these mistakes again, and for the future, we will never make these mistakes again.
  • Time Management. We made sure to plan and manage our time with a schedule of what each person would do and when.
  • Team Work. Speaking of a schedule, this helped us with teamwork where we could plan what each person would do according to everyones schedule.

Redone Popcorn Hacks

#Challenge Homework Hack for 3.3 Mathematical Expressions. (Did not do challenge hack, attempting it)

import math

def fibonacci(n):
    """Return the nth term in the Fibonacci sequence."""
    if n < 0:
        raise ValueError("Input should be a non-negative integer.")
    elif n == 0:
        return 0
    elif n == 1:
        return 1
    else:
        a, b = 0, 1
        for _ in range(2, n + 1):
            a, b = b, a + b
        return b

def calculate_area():
    """Calculate the area of a circle, square, or rectangle."""
    shape = input("Enter the shape (circle, square, rectangle): ").lower()
    
    if shape == "circle":
        radius = float(input("Enter the radius of the circle: "))
        area = math.pi * (radius ** 2)
        print(f"The area of the circle is: {area:.2f}")
        
    elif shape == "square":
        side = float(input("Enter the side length of the square: "))
        area = side ** 2
        print(f"The area of the square is: {area:.2f}")
        
    elif shape == "rectangle":
        length = float(input("Enter the length of the rectangle: "))
        width = float(input("Enter the width of the rectangle: "))
        area = length * width
        print(f"The area of the rectangle is: {area:.2f}")
        
    else:
        print("Invalid shape. Please enter circle, square, or rectangle.")

def calculate_volume():
    """Calculate the volume of a rectangular prism, sphere, or pyramid."""
    solid = input("Enter the solid (rectangular prism, sphere, pyramid): ").lower()
    
    if solid == "rectangular prism":
        base = float(input("Enter the base length of the rectangular prism: "))
        width = float(input("Enter the width of the rectangular prism: "))
        height = float(input("Enter the height of the rectangular prism: "))
        volume = base * width * height
        print(f"The volume of the rectangular prism is: {volume:.2f}")
        
    elif solid == "sphere":
        radius = float(input("Enter the radius of the sphere: "))
        volume = (4/3) * math.pi * (radius ** 3)
        print(f"The volume of the sphere is: {volume:.2f}")
        
    elif solid == "pyramid":
        base = float(input("Enter the base length of the pyramid: "))
        width = float(input("Enter the width of the pyramid: "))
        height = float(input("Enter the height of the pyramid: "))
        volume = (1/3) * base * width * height
        print(f"The volume of the pyramid is: {volume:.2f}")
        
    else:
        print("Invalid solid. Please enter rectangular prism, sphere, or pyramid.")


if __name__ == "__main__":
    
    term = int(input("Enter the Fibonacci term to calculate (0 for the first term): "))
    print(f"The {term}th term in the Fibonacci sequence is: {fibonacci(term)}")

    
    calculate_area()

    
    calculate_volume()

Enter the Fibonacci term to calculate (0 for the first term): 5
The 5th term in the Fibonacci sequence is: 5
Enter the shape (circle, square, rectangle): circle
Enter the radius of the circle: 10
The area of the circle is: 314.16
Enter the solid (rectangular prism, sphere, pyramid): pyramid
Enter the base length of the pyramid: 8
Enter the width of the pyramid: 3
Enter the height of the pyramid: 10
The volume of the pyramid is: 80.00
#3.5 Booleans Homework Hack Rework

def truth_table():
    print("A\tB\tA AND B\tA OR B\tNOT A\tNOT B\t¬(A AND B)\t¬A OR ¬B\t¬(A OR B)\t¬A AND ¬B")
    print("-" * 85)
    
    for A in [True, False]:
        for B in [True, False]:
            
            A_and_B = A and B
            A_or_B = A or B
            not_A = not A
            not_B = not B
            not_A_and_B = not (A and B)  
            not_A_or_not_B = not_A or not_B  
            not_A_or_B = not (A or B)  
            not_A_and_not_B = not_A and not_B  
            
            
            print(f"{A}\t{B}\t{A_and_B}\t\t{A_or_B}\t{not_A}\t{not_B}\t{not_A_and_B}\t\t{not_A_or_not_B}\t{not_A_or_B}\t\t{not_A_and_not_B}")


truth_table()

A	B	A AND B	A OR B	NOT A	NOT B	¬(A AND B)	¬A OR ¬B	¬(A OR B)	¬A AND ¬B
-------------------------------------------------------------------------------------
True	True	True		True	False	False	False		False	False		False
True	False	False		True	False	True	True		True	False		False
False	True	False		True	True	False	True		True	False		False
False	False	False		False	True	True	True		True	True		True