#Popcorn Hack 1

name = "Lincoln Crowell"

print(name)

age = "15"

print(age)
Lincoln Crowell
15
#Popcorn Hack 2

movie = "Star Wars"
print(movie)

number_of_movies = "9"
print(number_of_movies)
Star Wars
9
#Popcorn Hack 3

num1 = 100
num2 = 200
num3 = 300
num1 = num3
num2 = num1
num3 = num2
print(str(num1)+" "+str(num3))
300 300
#Popcorn Hack 3

information = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"

list = information
print(list)
ABCDEFGHIJKLMNOPQRSTUVWXYZ
#Popcorn Hack 4
def __init__(self, name, age):
    self.name = name
    self.age = age

#Popcorn Hack 5

dictionary = {
    "Name: ": "Lincoln",
    "Age: ": "15",
    "Favorite_Game: ": "COD",
}

print(dictionary)
{'Name: ': 'Lincoln', 'Age: ': '15', 'Favorite_Game: ': 'COD'}
#Homework Part 1
class Person:
    def __init__(self, name, age):
        self.name = name
        self.age = age

def print_people(people):
    for person in people:
        print(f"Name: {person.name}, Age: {person.age}")

person1 = Person("Ronit", 15)
person2 = Person("Lincoln", 15)
person3 = Person("Ishan", 15)

people_list = [person1, person2, person3]


print_people(people_list)
Name: Ronit, Age: 15
Name: Lincoln, Age: 15
Name: Ishan, Age: 15
#Homework Part 2
def find_oldest_person(people):
    oldest_name = None
    max_age = -1
    
    for name, age in people.items():
        if age > max_age:
            max_age = age
            oldest_name = name
    
    if oldest_name is not None:
        print(f"The oldest person is {oldest_name} with an age of {max_age}.")
    else:
        print("The provided dictionary is empty.")

family_dict = {
    "Mom": 48,
    "Dad": 44,
    "Lincoln": 15
}

find_oldest_person(family_dict)

The oldest person is Mom with an age of 48.
#Hack 2
import json

movie_theater = {}

movie1 = {
    "title": "Revenge of the sith",
    "rating": "9/10",
    "best characters": ["Anakin Skywalker"+" "+"and Obi Wan"]
}

movie2 = {
    "title": "Empire Strikes Back",
    "rating": "9/10",
    "best characters": ["Darth Vader"+" "+"and Luke Skywalker"]
}

movie_theater["movie1"] = movie1
movie_theater["movie2"] = movie2


with open('library.json', 'w') as file:
    json.dump(movie_theater, file)


with open('library.json', 'r') as file:
    loaded_library = json.load(file)


print("Loaded Library:")
for book_id, book_info in loaded_library.items():
    print(f"Movie ID: {book_id}")
    print(f"Title: {book_info['title']}")
    print(f"Rating: {book_info['rating']}")
    print(f"best characters: {', '.join(book_info['best characters'])}\n")
Loaded Library:
Movie ID: movie1
Title: Revenge of the sith
Rating: 9/10
best characters: Anakin Skywalker and Obi Wan

Movie ID: movie2
Title: Empire Strikes Back
Rating: 9/10
best characters: Darth Vader and Luke Skywalker