<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} files above the sky")

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

  def add(self):
    return self.__a +self.__b #Private attributes

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

number.a = 7 #7,4 7+4 = 11

number.add()<jupyter_output><empty_output><jupyter_text>Encapsulation with Private Attributes<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

num = Counter()
num.increment()   #counter = counter + 1
num.increment()
num.increment()

num.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

num = Counter()

num.increment()   #counter = counter + 1
num.increment()
num.increment()

num.counter = 1

num.value()<jupyter_output><empty_output><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("Jea", "Gadil")
person.printname()

class Teacher(Person):
  pass

person2 = Teacher("Maria", "Sayo")
person2.printname()

class Student(Person):
  pass

person3 = Student("<NAME>", "Umipig")
person3.printname()<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 11. Create a Python program that displays the name of three students (Student 1, Student 2, and Student 3) and their term grades2. 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,std,pre,mid,fin):
    self.__std = std
    self.__pre = pre
    self.__mid = mid
    self.__fin = fin

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

class Student1(Person):
  pass

std1 = str(input("Enter student name: "))
pre_1 = float(input("Enter Prelim Grade: "))
mid_1 = float(input("Enter Midterm Grade: "))
fin_1 = float(input("Enter Final Grade: "))

Student_1 = Person(std1, pre_1, mid_1, fin_1)

print()


class Student2(Person):
  pass

std2 = str(input("Enter student name: "))
pre_2 = float(input("Enter Prelim Grade: "))
mid_2 = float(input("Enter Midterm Grade: "))
fin_2 = float(input("Enter Final Grade: "))

Student_2 = Person(std2, pre_2, mid_2, fin_2)

print()

class Student3(Person):
  pass

std3 = str(input("Enter student name: "))
pre_3 = float(input("Enter Prelim Grade: "))
mid_3 = float(input("Enter Midterm Grade: "))
fin_3 = float(input("Enter Final Grade: "))

Student_3 = Person(std3, pre_3, mid_3, fin_3)

print()

student_name = str(input("Enter Student Name: "))

if student_name == (std1):
  print ("Name:", std1, "\nAverage:", Student_1.Grade())
else:
  if student_name == (std2):
    print("Name:", std2, "\nAverage:", Student_2.Grade())
  else:
    if student_name == (std3):
      print("Name:", std3, "\nAverage:", Student_3.Grade())
    else:
      print("That name was Not Register")<jupyter_output>Enter student name: Ian
Enter Prelim Grade: 98
Enter Midterm Grade: 98
Enter Final Grade: 97

Enter student name: Rafael
Enter Prelim Grade: 97
Enter Midterm Grade: 96
Enter Final Grade: 95

Enter student name: Umipig
Enter Prelim Grade: 97
Enter Midterm Grade: 98
Enter Final Grade: 91

Enter Student Name: Umipig
Name: Umipig 
Average: 95.33
StarcoderdataJupyterStructuredCleanDedup