Open utterances-bot opened 1 year ago
I commented on the original instructions as well, please ignore that.
Name: Ronit Thomas Period:5
My Popcorn Hacks followed by the Homework Hacks: https://ronitt1234.github.io/CSP_BLOG_RT//2023/10/04/Data-Abstraction_IPYNB_2_.html
Name : Ishan Cornick Class : CSP Period : 5 Link : https://ishancornick.github.io/new_student//2023/10/04/python-homework_IPYNB_2_.html
Aashray Rajagopalan Period 5 https://github.com/aashrayr/student2/blob/main/_notebooks/2023-10-04-data-abstraction.ipynb
Vance Reynolds Period 5 https://vancereynolds.github.io/cspblog2//2023/10/04/DataAbstractionPresnetation_IPYNB_2_.html
Lincoln Crowell Period 5
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
```python
#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": 47,
"Dad": 44,
"Lincoln": 15
}
find_oldest_person(family_dict)
The oldest person is Mom with an age of 47.
Please ignore my other comment, I did not understand the instructions.
Lincoln Crowell Period 5 https://lincolnc2008.github.io/student3//2023/04/10/Data-Abstractions_IPYNB_2_.html
Gurshawn Boparai Period 5 https://gurbop.github.io/CSPBlog2//2023/10/05/data_IPYNB_2_.html
Jared Baza Period 5 I commented on the other post, ignore that http://127.0.0.1:4200/JaredsBlog//2023/10/04/DataAbstraction_IPYNB_2_.html
Akhil Singamneni Period 5 https://akhil353.github.io/student//2023/10/04/data-abstraction_IPYNB_2_.html
Aditi Bharadwaj Period 5 https://aditi99b.github.io/notebook//2023/10/04/Data_abstraction_IPYNB_2_.html
Cindy Liang Period 5 https://cliang1.github.io/cliang//2023/10/04/Data-Abstraction_IPYNB_2_.html
Ashwin Visvanath Period 5 https://ashwinv93.github.io/CompSci//2023/10/04/DataAbstraction_IPYNB_2_.html
Eshika Pallapotu Period 5 https://eshikap1.github.io/Student2//2023/10/04/Student_Teaching_Hacks_GROUP1_IPYNB_2_.html
Name: Imaad Muzaffer Period: 5 https://imaad08.github.io/student2/2023/10/05/dataAbstraction_IPYNB_2_.html
Sergi Serpukhovitinov Period 5 https://jm1021.github.io/sergiStudent//2023/10/04/Data-Abstracion-hacks_IPYNB_2_.html
Samhita Lagisetti Period 5 https://samhita-l.github.io/compsci//2023/10/04/Python-Student-Teaching_IPYNB_2_.html
Anika Bhatnagar Period 5 https://github.com/anikabhatnagar20/anikabhatnagar20.git
Jason Guan Period 5 https://jasonguan1012.github.io/student//2023/10/03/PythonTeaching_IPYNB_2_.html
Eshaan Kumar Period 5 https://eshaank1.github.io/csp//2023/10/04/DataAbstraction_IPYNB_2_.html
class Person: def init(self, name, age): self.name = name; self.age = age;
person1 = Person("John", 13); person2 = Person("Doe", 16); person3 = Person("HON", 12);
lst = [person1, person2, person3]; def print_people(Personlst): for i in range(len(Personlst)): print(Personlst[i].name, end= ": "); print(Personlst[i].age);
print_people(lst);
dict = { "one": person1, "two": person2, "three": person3, } def print_oldest(pdict): oldest = list(pdict.keys())[0] oldest_age = pdict[oldest].age for name in pdict.keys(): if pdict[name].age > oldest_age: oldest = name oldest_age = pdict[name].age print(pdict[oldest].name)
print_oldest(dict)
import json
secretNumber = 15 print(secretNumber) #int print(type(secretNumber))
food = "Pizza" print(food) #string print(type(food))
names = ["Nandan", "Arnav", "Torin", "Remy"] print(names) # array or list print(type(names))
IamCool = True
print(IamCool) # boolean print(type(IamCool))
names_2 = { "Nandan": "TeamMate1", "Arnav": "TeamMate2", "Torin": "TeamMate3", "Remy": "TeamMate4", }
print(names_2) #dictionary print(type(names_2))
variables = { "numbers": [1,2,3,4,5], "names": ["John", "Robert", "Bob", "Doe", "Bill"], "isDict": True, }
def print_largest(dict): max = dict["numbers"][0]; for i in range(1, len(dict["numbers"])): if max < dict["numbers"][i]: max = dict["numbers"][i]; print(f"Largest Number is {max}")
longestName = dict["names"][1]; max = len(dict["names"][0]) for i in range(1, len(dict["names"])): if max < len(dict["names"][i]): max = len(dict["names"][1]); print(f"Longest Name is {longestName}");
if(dict["isDict"]): print("This is a dictionary"); else: print("This is not a dictionary"); print_largest(variables);
P5 Data Abstraction | Compci Blogs
Period 5 Student led teaching on Data Abstraction
https://nighthawkcoders.github.io/teacher/2023/10/04/CSP-Data_Abstraction-P5_IPYNB2.html