<jupyter_start><jupyter_text>Classes with multiple Objects<jupyter_code>class Birds:
  def __init__(self,bird_name):
    self.bird_name = bird_name
  def flying_birds(self):
    print(f"{self.bird_name} flies above clouds")
  def non_flying_birds(self):
    print(f"{self.bird_name} is the national bird of the Philippines")
  
vulture = Birds("Griffon Vulture")
crane = Birds("Common Crane")
emu = Birds ("Eagle")

vulture.flying_birds()
crane.flying_birds()
emu.non_flying_birds()<jupyter_output>Griffon Vulture flies above clouds
Common Crane flies above clouds
Eagle is the national bird of the Philippines<jupyter_text>Classes with multiple Objects<jupyter_code>class foo:
  def __init__(self,a,b):
    self._a = a
    self._b = b
  def add(self):
    return self._a +self._b
foo_object = foo(3,4)
#foo_object.add()

foo_object.a=6
foo_object.add()<jupyter_output><empty_output><jupyter_text>Encapsulation by Mangling with Double Underscores<jupyter_code>class Counter:
    def __init__(self):
        self.current = 0

    def increment(self):
        self.current += 1

    def value(self):
        return self.current

    def reset(self):
        self.current = 0

counter = Counter()


counter.increment()
counter.increment()
counter.increment()

print(counter.value())<jupyter_output><empty_output><jupyter_text>Inheritance<jupyter_code>class Person:
  def __init__(self,fname,sname):
    self.fname = fname
    self.sname = sname
  def printname(self):
    print(self.fname,self.sname)

x = Person("<NAME>","Lambojo")
x.printname()

class Teacher(Person):
  pass

x = Teacher("Rizette", "Sayo")
x.printname()<jupyter_output><NAME>
<NAME><jupyter_text>Polymorphism<jupyter_code>class RegularPolygon:
  def __init__(self,side):
    self._side = side
class Square(RegularPolygon):
  def area(self):
    return self._side * self._side
class EquilateralTriangle(RegularPolygon):
  def area(self):
    return self._side * self._side * 0.433

obj1 = Square(4)
obj2 = EquilateralTriangle(3)

obj1.area()
obj2.area()<jupyter_output><empty_output><jupyter_text>Application 1 - 30% Prelims, 30% Midterms, 40% Final = Sem GradeCreate a Python program that displays the name of 3 students (Student 1, Student 2, Student 3) and their gradesCreate a class name "Person" and attributes - std1, std2, std3, pre, mid, finCompute for the average grade of each term using Grade() methodInformation about student's grades must be hidden from others<jupyter_code>import random

class Person:
  def __init__ (self, student, pre, mid, fin):
    self.student = student
    self.pre = pre *0.30
    self.mid = mid *0.30
    self.fin = fin *0.40

  def Grade (self):
    print (self.student, "has an average grade of", self.pre, "in Prelims")
    print (self.student, "has an average grade of", self.mid, "in Midterms")
    print (self.student, "has an average grade of", self.fin, "in Finals")

std1 = Person ("Jacob", random.randint(70,100), random.randint(70,100), random.randint(70,100))
std2 = Person ("Rorenz", random.randint(70,100), random.randint(70,100), random.randint(70,100))
std3 = Person ("Lambojo", random.randint(70,100), random.randint(70,100), random.randint(70,100))

std1.Grade()<jupyter_output>Jacob has an average grade of 23.099999999999998 in Prelims
Jacob has an average grade of 29.7 in Midterms
Jacob has an average grade of 28.8 in Finals
{'fraction_non_alphanumeric': 0.11813842482100238, 'fraction_numerical': 0.0331145584725537, 'mean_word_length': 4.87215411558669, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 25, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 1, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '6', 'dir': 'jupyter-structured-clean-dedup', 'id': '59591', 'license': 'Apache-2.0', 'n_tokens_mistral': 1254, 'n_tokens_neox': 1148, 'n_words': 306, 'path': 'OOP_Concepts_2.ipynb', 'repo_name': 'Nachtttt/OOP-58002', 'size': '3398'}