<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

foo_object = foo(1,5)
foo_object.add()
class foo:
  def __init__(self,c,d):
    self.c = c
    self.d = d
  def add(self):
    return self.c + self.d

foo_object = foo(3,4)
foo_object.add()

foo_object.c = 6
foo_object.add()
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())
#print(counter.reset())<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("Maria", "Sayo")
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)

print(obj1.area())
print(obj2.area())<jupyter_output>16
3.897<jupyter_text>1. Create a python program that displays the name of three students (Student 1, Student 2, Student 3) and their term grades2. Create a class name person and attribute - std1, std2, std3, pre, mid, fin3. Compute the average of each term grade using Grade() method4. Information about students' grades must be hidden from othersSemestral Grade:Prelim = 30%, Midterm = 30%, Final = 40%<jupyter_code>print("Choose a student : ")
print("1) Jerome \n2) Alexandra \n3) Pikachu")
print("\nInput : ")
x = input()

if x == "1":
  class person:
    def __init__(self):
      self.std = "\nJerome"
      self.pre = 75
      self.mid = 75
      self.fin = 75

    def grade(self):
      return self.pre*0.30 + self.mid*0.30 + self.fin*0.40

elif x == "2":
  class person:
    def __init__(self):
      self.std = "\nAlexandra"
      self.pre = 80
      self.mid = 80
      self.fin = 80

    def grade(self):
      return self.pre*0.30 + self.mid*0.30 + self.fin*0.40

elif x == "3":
  class person:
    def __init__(self):
      self.std = "\nPikachu"
      self.pre = 90
      self.mid = 90
      self.fin = 90

    def grade(self):
     return self.pre*0.30 + self.mid*0.30 + self.fin*0.40

ob = person()
print(ob.std)
print("\n\nPrelim : ",ob.pre)
print("Midterm : ",ob.pre)
print("Final : ",ob.pre)
print("\nGrade : ",ob.grade())<jupyter_output>Choose a student : 
1) Jerome 
2) Alexandra 
3) Pikachu

Input : 
1

Jerome


Prelim :  75
Midterm :  75
Final :  75

Grade :  75.0
{'fraction_non_alphanumeric': 0.13227953410981697, 'fraction_numerical': 0.028840820854132, 'mean_word_length': 3.520050125313283, 'pattern_counts': {'":': 3, '<': 19, '<?xml version=': 0, '>': 19, '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': '5', 'dir': 'jupyter-structured-clean-dedup', 'id': '207554', 'license': 'Apache-2.0', 'n_tokens_mistral': 1400, 'n_tokens_neox': 1309, 'n_words': 326, 'path': 'OOP_Concepts_2.ipynb', 'repo_name': 'momonts/OOP-58001', 'size': '3616'}