<jupyter_start><jupyter_text>Classes with Multiple Objects<jupyter_code>class Birds:
  def __init__(self,birds_name):
    self.birds_name = birds_name
  def flying_birds(self):
    print(f"{self.birds_name} flies above the sky")
  def non_flying_birds(self):
    print(f"{self.birds_name} is the national bird of Australia")

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 the sky
Common Crane flies above the sky
Emu is the national bird of Australia<jupyter_text>Encapsulation (mangling with double underscore)<jupyter_code>class foo:
 def __init__(self,a,b):
  self.__a = a
  self.__b = b
 
 def add(self):
  return self.__a+ self.__b

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

object_foo.__a = 6
object_foo.__b = 7
object_foo.add()



class Counter:
  def __init__(self):
    self.current = 0
  def increment(self):
    self.current = 1
  def value(self):
    self.current
  def reset(self):
    self.current = 0 

number = Counter()
number.increment()


print(number.value())
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 

number = Counter()
number.__current = 1

number.increment()
number.increment()
number.increment()


print(number.value())<jupyter_output>3<jupyter_text>Inheritance<jupyter_code>class Person:
  def __init__(self,firstname,surname):
    self.firstname = firstname
    self.surname = surname

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

person = Person("John", "Daguio")
person.fullname()

class Teacher(Person):
  pass

person2 = Teacher("Maam","Maria")
person2.fullname()

class Student(Person):
  pass

person3 = Student("Lance","Alcala")
person3.fullname()<jupyter_output><NAME>
<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)
print(obj1.area())

obj2 = EquilateralTriangle(3)
print(obj2.area())<jupyter_output>16
3.897<jupyter_text>Application 11. Create a Python program that displays the name of three students(Student 1, Student 2, and Student 3) and their term grades.2. 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:
  def __init__(self,std1, pre):
    self.__std1 = std1
    self.__pre = pre
  def student_name(self):
    print("The name of student =",f"{self.__std1}")
  def Grade(self):
    print("Grade =",f"{self.__pre*0.7 + self.__pre*0.3}") 

person1 = Person("Student 1", 70) #the grade 70 represents the total score for both activities and exam
person1.student_name()
person1.Grade()

class Mid(Person):
  pass 
person12 = Mid("Student 1", 90) #the grade 90 represents the total score for both activities and exam

person12.student_name()
person12.Grade()

class Fin(Person):
  pass

person13 = Fin("Student 1", 80) #the grade 80 represents the total score for both activities and exam
person13.student_name()
person13.Grade()

class Student2(Person):
  pass 

person2 = Student2("Student 2", 76) #the grade 76 represents the total score for both activities and exam
person2.student_name()
person2.Grade()

class Mid2(Person):
  pass

person22 = Student2("Student 2", 85) #the grade 85 represents the total score for both activities and exam 
person22.student_name()
person22.Grade()

class Fin2(Person):
  pass
person23 = Student2("Student 2", 94) #the grade 94 represents the total score for both activities and exam
person23.student_name()
person23.Grade()

class Student3(Person):
  pass
person3 = Student3("Student 3", 87) #the grade 87 represents the total score for both activities and exam
person3.student_name()
person3.Grade()

class Mid3(Person):
  pass
person32 = Mid3("Student 3", 79) #the grade 79 represents the total score for both activities and exam
person32.student_name()
person32.Grade()

class Fin3(Person):
  pass
person33 = Fin3("Student 3", 96) #the grade 96 represents the total score for both activities and exam
person33.student_name()
person33.Grade()<jupyter_output>The name of student = Student 1
Grade = 70.0
The name of student = Student 1
Grade = 90.0
The name of student = Student 1
Grade = 80.0
The name of student = Student 2
Grade = 76.0
The name of student = Student 2
Grade = 85.0
The name of student = Student 2
Grade = 94.0
The name of student = Student 3
Grade = 87.0
The name of student = Student 3
Grade = 79.0
The name of student = Student 3
Grade = 95.99999999999999
{'fraction_non_alphanumeric': 0.1062144597887896, 'fraction_numerical': 0.041023558082859464, 'mean_word_length': 4.828402366863905, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 19, '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': '5', 'dir': 'jupyter-structured-clean-dedup', 'id': '490787', 'license': 'Apache-2.0', 'n_tokens_mistral': 1775, 'n_tokens_neox': 1592, 'n_words': 508, 'path': 'OOP_Concepts_2.ipynb', 'repo_name': 'johndaguio/OOP---1-1', 'size': '4939'}