<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

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

object_foo.__a = 6
object_foo.__b = 9
object_foo.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

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("Mark","Mamauag")
person.fullname()

class Teacher(Person):
  pass

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

class Student(Person):
  pass

person3 = Student("Godfrey","Mamauag")
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

object = Square(4)
print(object.area())

object2 = EquilateralTriangle(3)
print(object2.area())<jupyter_output>16
3.897<jupyter_text>Application 1<jupyter_code>class Person:
  def __init__(self, firstname, lastname):
    self.firstname = firstname
    self.lastname = lastname

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

std1 = Person("<NAME>", "Mamauag")
std1.fullname()

class Student(Person):
  pass

input_pre = float(input("Prelims: "))
input_mid = float(input("Midterms: "))
input_fin = float(input("Finals: "))

class Average:
  def __init__(self, pre, mid, fin):
    self.__pre = pre
    self.__mid = mid
    self.__fin = fin

  def Grade(self):
    return (self.__pre + self.__mid + self.__fin)/3

average = Average(input_pre, input_mid, input_fin)
print("Average:",average.Grade())

std2 = Person("\nGab", "Jawo")
std2.fullname()

class Student(Person):
  pass

input_pre = float(input("Prelims: "))
input_mid = float(input("Midterms: "))
input_fin = float(input("Finals: "))

class Average:
  def __init__(self, pre, mid, fin):
    self.__pre = pre
    self.__mid = mid
    self.__fin = fin

  def Grade(self):
    return (self.__pre + self.__mid + self.__fin)/3

average = Average(input_pre, input_mid, input_fin)
print("Average:",average.Grade())

std3 = Person("\nArchel", "Jane")
std3.fullname()

class Student(Person):
  pass

input_pre = float(input("Prelims: "))
input_mid = float(input("Midterms: "))
input_fin = float(input("Finals: "))

class Average:
  def __init__(self, pre, mid, fin):
    self.__pre = pre
    self.__mid = mid
    self.__fin = fin

  def Grade(self):
    return (self.__pre + self.__mid + self.__fin)/3

average = Average(input_pre, input_mid, input_fin)
print("Average:",average.Grade())<jupyter_output><NAME>
Prelims: 1.0
Midterms: 1.25
Finals: 3.0
Average: 1.75

<NAME>
Prelims: 1.25
Midterms: 1.50
Finals: 2.
Average: 1.5833333333333333

<NAME>
Prelims: 3.24
Midterms: 2
Finals: 1
Average: 2.08
{'fraction_non_alphanumeric': 0.13724489795918368, 'fraction_numerical': 0.020153061224489795, 'mean_word_length': 4.817507418397626, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 23, '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': '325591', 'license': 'Apache-2.0', 'n_tokens_mistral': 1528, 'n_tokens_neox': 1421, 'n_words': 305, 'path': 'OOP_Concepts(2).ipynb', 'repo_name': 'GodfreyMamauag/OOP-1-2', 'size': '3965'}