basketball
football
soccer
tennis
golf
["basketball", "football", "soccer", "tennis", "golf"]
%%python
secretNumber = 15
print(secretNumber)
print(type(secretNumber))
food = "Pizza"
print(food)
print(type(food))
names = ["Nandan", "Arnav", "Torin", "Remy"]
print(names)
print(type(names))
IamCool = True
print(IamCool)
print(type(IamCool))
##Bonus Problem:
names_2 = {
"Nandan": "TeamMate1",
"Arnav": "TeamMate2",
"Torin": "TeamMate3",
"Remy": "TeamMate4",
}
print(names_2)
print(type(names_2))
15
<class 'int'>
Pizza
<class 'str'>
['Nandan', 'Arnav', 'Torin', 'Remy']
<class 'list'>
True
<class 'bool'>
{'Nandan': 'TeamMate1', 'Arnav': 'TeamMate2', 'Torin': 'TeamMate3', 'Remy': 'TeamMate4'}
<class 'dict'>
My name is eshaan and I am 16 years old.
%%python
class Person:
def __init__(self, name, age):
self.name = name
self.age = age
def print_people(self):
print(self.name + " is " + str(self.age) + " years old.")
def oldest_person(people):
oldest = None
for person in people:
if oldest == None:
oldest = person
elif person.age > oldest.age:
oldest = person
print(oldest.name + " is the oldest person.")
p1 = Person("Eshaan", 16)
p2 = Person("Aaron", 14)
p3 = Person("Brandon", 15)
p4 = Person("Ninaad", 18)
people = {p1, p2, p3, p4}
p1.print_people()
p2.print_people()
p3.print_people()
p4.print_people()
oldest_person(people)
Eshaan is 16 years old.
Aaron is 14 years old.
Brandon is 15 years old.
Ninaad is 18 years old.
Ninaad is the oldest person.