<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<jupyter_code>class foo:
  def __init__(self,a,b):
    self._a = a
    self._b = b

  def add(self):
    return self._a + self._b
  def sub(self):
    return self._a - self._b
foo_object = foo(3,4)

foo_object._b = 5 
#print(foo_object.b)
print(foo_object.add()) #adding a and b
print(foo_object.sub()) #subtracting a and b<jupyter_output>8
-2<jupyter_text>Inheritance<jupyter_code>class Person:
  def __init__(self,firstname,surname):
    self.firstname = firstname
    self.surname = surname

  def printname(self):
    print(self.firstname, self.surname)

person = Person("Mam", "Sayo")
person.printname()

class Student(Person):
  pass

person = Student("Ashley", "Goce")
person.printname()<jupyter_output><NAME>
<NAME><jupyter_text>Application 1 Class with Multiple Objects Application-Create a Python program that displays the name of 3 students (Student 1, Student 2, Student 3) and their grades-Create a class name "Person" and attributes - std1, std2, std3, pre, mid, fin-Compute for the average grade of each term using Grade() method-Information 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,",  self.mid, "in midterms, and",  self.fin, "in finals")


std1 = Person ("<NAME>", random.randint(85,98), random.randint(89,99), random.randint(91,99))
std2 = Person ("<NAME>", random.randint(90,97), random.randint(92,98), random.randint(95,99))
std3 = Person ("<NAME>", random.randint(78,99), random.randint(80,99), random.randint(85,99))

std1.Grade()
std2.Grade()
std3.Grade()<jupyter_output><NAME> has an average grade of 29.099999999999998 in prelims, 29.099999999999998 in midterms, and 38.0 in finals
<NAME> has an average grade of 28.2 in prelims, 29.099999999999998 in midterms, and 38.800000000000004 in finals
<NAME> has an average grade of 27.0 in prelims, 29.4 in midterms, and 37.6 in finals
{'fraction_non_alphanumeric': 0.12130069419071976, 'fraction_numerical': 0.05370843989769821, 'mean_word_length': 4.939262472885033, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 4, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '4', 'dir': 'jupyter-structured-clean-dedup', 'id': '551080', 'license': 'Apache-2.0', 'n_tokens_mistral': 1076, 'n_tokens_neox': 946, 'n_words': 273, 'path': 'OOP_2.ipynb', 'repo_name': 'kcisidro/OOP-58002', 'size': '2786'}