<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 (private)<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.__current)
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("Yumang","James")
x.printname()

class Student(Person):
  pass

x = Student("James","Yumang")
x.printname()<jupyter_output><NAME>
<NAME><jupyter_text>Polymorphism<jupyter_code>class RegularPolygon:
    def __init__(self, side=1):
        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>Application 1 1. Create a Python program that displays the name of three students (Student 1, Stundent 2 and Student 3) and their term grades 2. Create a class name Person and attributes - std.1,std2,std3,pre,mid,fin3. Compute the average of each term grade using Grade() method 4. Information about student's grades must be hidden from others<jupyter_code>class Person:
  def __init__(self, name, pre, mid, fin):
    self._name = name
    self._pre = pre
    self._mid = mid
    self._fin = fin
  def Grades(self):
     return print(self._name, "get a semestral grade with a total of ", self._pre*.30 + self._mid*.30 + self._fin*.40)

std1 = Person("<NAME>",93 ,96,91) 

std2 = Person("<NAME>",89,94,90)

std3 = Person("<NAME>",68,70,79)

print("Student 1 = <NAME>")
print("Student 2 = <NAME>")
print("Student 3 = <NAME>")

x = input(str("Input desired student number to view the grade (Student 1-3): "))

if x == "Student 1":
  std1.Grades()
else:
  if x == "Student 2":
    std2.Grades()
  else:
    if x == "Student 3":
      std3.Grades()
    else:
      print("Invalid Student")<jupyter_output>Student 1 = <NAME>
Student 2 = <NAME>
Student 3 = <NAME>
Input desired student number to view the grade (Student 1-3): Student 3
<NAME> get a semestral grade with a total of  73.0
{'fraction_non_alphanumeric': 0.12533020252421484, 'fraction_numerical': 0.023774581743469327, 'mean_word_length': 4.4528, 'pattern_counts': {'":': 3, '<': 33, '<?xml version=': 0, '>': 33, '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': '75453', 'license': 'Apache-2.0', 'n_tokens_mistral': 1240, 'n_tokens_neox': 1170, 'n_words': 309, 'path': 'OOP_Concepts_2.ipynb', 'repo_name': 'JamesYu03/OOP-58001', 'size': '3471'}