nighthawkcoders / teacher

Jupyter Notebooks and Posts dedicated to learning Python
MIT License
0 stars 63 forks source link

P5 Data Abstraction | Compci Blogs #13

Open utterances-bot opened 1 year ago

utterances-bot commented 1 year ago

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

iwu78 commented 1 year ago

Homework - Ian W.

I commented on the original instructions as well, please ignore that.

RonitT1234 commented 1 year ago

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

IshanCornick commented 1 year ago

Name : Ishan Cornick Class : CSP Period : 5 Link : https://ishancornick.github.io/new_student//2023/10/04/python-homework_IPYNB_2_.html

aashrayr commented 1 year ago

Aashray Rajagopalan Period 5 https://github.com/aashrayr/student2/blob/main/_notebooks/2023-10-04-data-abstraction.ipynb

trevorhuang1 commented 1 year ago

Trevor Huang P5 https://trevorhuang1.github.io/csp_blog//2023/10/04/Data-Abstraction_IPYNB_2_.html

VanceReynolds commented 1 year ago

Vance Reynolds Period 5 https://vancereynolds.github.io/cspblog2//2023/10/04/DataAbstractionPresnetation_IPYNB_2_.html

LincolnC2008 commented 1 year ago

Lincoln Crowell Period 5

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

```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.
LincolnC2008 commented 1 year ago

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

Gurbop commented 1 year ago

Gurshawn Boparai Period 5 https://gurbop.github.io/CSPBlog2//2023/10/05/data_IPYNB_2_.html

JBaza12 commented 1 year ago

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

Akhil353 commented 1 year ago

Akhil Singamneni Period 5 https://akhil353.github.io/student//2023/10/04/data-abstraction_IPYNB_2_.html

Aditi99b commented 1 year ago

Aditi Bharadwaj Period 5 https://aditi99b.github.io/notebook//2023/10/04/Data_abstraction_IPYNB_2_.html

cliang1 commented 1 year ago

Cindy Liang Period 5 https://cliang1.github.io/cliang//2023/10/04/Data-Abstraction_IPYNB_2_.html

Ashwinv93 commented 1 year ago

Ashwin Visvanath Period 5 https://ashwinv93.github.io/CompSci//2023/10/04/DataAbstraction_IPYNB_2_.html

advikg commented 1 year ago

https://advikg.github.io/student/2023/10/04/Data-Abstraction_IPYNB_2_.html

EshikaP1 commented 1 year ago

Eshika Pallapotu Period 5 https://eshikap1.github.io/Student2//2023/10/04/Student_Teaching_Hacks_GROUP1_IPYNB_2_.html

Imaad08 commented 1 year ago

Name: Imaad Muzaffer Period: 5 https://imaad08.github.io/student2/2023/10/05/dataAbstraction_IPYNB_2_.html

sergi1207 commented 1 year ago

Sergi Serpukhovitinov Period 5 https://jm1021.github.io/sergiStudent//2023/10/04/Data-Abstracion-hacks_IPYNB_2_.html

samhita-l commented 1 year ago

Samhita Lagisetti Period 5 https://samhita-l.github.io/compsci//2023/10/04/Python-Student-Teaching_IPYNB_2_.html

anikabhatnagar20 commented 1 year ago

Anika Bhatnagar Period 5 https://github.com/anikabhatnagar20/anikabhatnagar20.git

JasonGuan1012 commented 1 year ago

Jason Guan Period 5 https://jasonguan1012.github.io/student//2023/10/03/PythonTeaching_IPYNB_2_.html

eshaank1 commented 1 year ago

Eshaan Kumar Period 5 https://eshaank1.github.io/csp//2023/10/04/DataAbstraction_IPYNB_2_.html

AnanyaAsudani commented 1 year ago

Ananya Asudani Period 5 https://github.com/AnanyaAsudani/Week2CSP/blob/main/_notebooks/2023-10-09-DataAbstraction-Homework.ipynb

AaronH1234 commented 1 year ago

Aaron Hsu Period 5 https://github.com/AaronH1234/student1/blob/main/_notebooks/2023-10-04-data_abstraction.ipynb

YeongsuKimm commented 1 year ago

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))

Bonus Problem:

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);

brandonso36 commented 1 year ago

Brandon So Period 5 https://brandonso36.github.io/brandonso//2023/10/04/Popcorn-Hacks-Data-Abstraction_IPYNB_2_.html

Be1uga4life commented 1 year ago

Eric Yu Period 5 https://be1uga4life.github.io/student/2023/10/04/dataabstraction_IPYNB_2_.html