<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("Emu")

vulture.flying_birds()
crane.flying_birds()
emu.non_flying_birds()<jupyter_output>Griffon Vulture flies above clouds
Common Crane flies above clouds
Emu is the national bird of the Philippines<jupyter_text>Encapsulation with Private Attributes<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  #current = current+1
  
  def value(self):
    return self.__current
  
  def reset(self):
    self.current = 0
  
counter = Counter()

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

print(counter.__current)<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>", "Barbado")
x.printname()

class Teacher(Person):
  pass

x = Teacher("Nathan", "Drake")
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

sq = Square(4)
et = EquilateralTriangle(1)

print(et.area()*sq.area())
class Shape:
  def __init__(self, l, h): 
    self._length = l 
    self._height = h

class Rectangle(Shape): 
  def area(self):
    return self._length * self._height

class Triangle(Shape):
  def area(self):
    return (self._length * self._height)/2

calculateArea = Rectangle(5, 10)
print("Area of Rectangle is: " + str(calculateArea.area()))
calculateArea = Triangle(5, 10)
print("Area of Triangle is: " + str(round(calculateArea.area())))<jupyter_output>Area of Rectangle is: 50
Area of Triangle is: 25<jupyter_text>Application 1 = 30% prelim, 30% midterm, 40% final = sem grade 1. Create a Python program that displays the name of three students (Student Student 2, and Student 3) and their term grades2. Create a class name Person and attributes - std1, std2, std3, pre, mid, fin3. Compute the average of each term grade using Grade() method4. Information about student's grades must be hidden from others<jupyter_code>class Person:     ##class name Person allowing to display the name of three students (Student Student 2, and Student 3) and their term grades.     
  def __init__(self, fname, pre, mid, fin):
    self.fname = fname     #represents the instance of the class named Person.
    self._pre = pre
    self._mid = mid
    self._fin = fin

  def Grade(self):    #Grade() method to display the student name and their term grades.
    print(f"{self.fname} \nPrelims: {self._pre:.2f} Midterms: {self._mid:.2f} Finals: {self._fin:.2f} \nSemestral Grade: {self._pre*0.30+self._mid*0.30+self._fin*0.40:.2f}\n")

class std1(Person):
  pass
class std2(Person):
  pass
class std3(Person):
  pass

Info1 = std1("Barbado, <NAME>", 1.25, 1.50, 1.00)
Info2 = std2("Belarmino, <NAME>", 1.00, 1.25, 1.25)
Info3 = std3("Belen, <NAME>", 1.25, 1.75, 1.50)

Info1.Grade()
Info2.Grade()
Info3.Grade()<jupyter_output>Barbado, <NAME> 
Prelims: 1.25 Midterms: 1.50 Finals: 1.00 
Semestral Grade: 1.23

Belarmino, <NAME> 
Prelims: 1.00 Midterms: 1.25 Finals: 1.25 
Semestral Grade: 1.18

Belen, <NAME> 
Prelims: 1.25 Midterms: 1.75 Finals: 1.50 
Semestral Grade: 1.50
{'fraction_non_alphanumeric': 0.12309552599758163, 'fraction_numerical': 0.03143893591293833, 'mean_word_length': 4.364461738002594, 'pattern_counts': {'":': 0, '<': 30, '<?xml version=': 0, '>': 30, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, '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': '241330', 'license': 'Apache-2.0', 'n_tokens_mistral': 1587, 'n_tokens_neox': 1465, 'n_words': 400, 'path': 'OOP_Concepts_2.ipynb', 'repo_name': 'RMBarbado/OOP-58001', 'size': '4209'}