<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>#Example 1
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()
#Example 2
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):
    return self.__current
  def reset(self):
    self.__current = 0

number = Counter()
number.__current = 1

number.increment()
number.increment()
number.increment()
#number.__current = 1


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("<NAME>", "Albero")
person.fullname()


class Teacher(Person):
  pass

person2 = Teacher("Justine", "Albero")
person2.fullname()


class Student(Person):
  pass

person3 = Teacher("Kate", "Albero")
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())
#Practice with input function (not included in the Application 1)

class Person:
  def __init__(self, Pre, Mid, Fin):
    self.__Pre = Pre
    self.__Mid = Mid
    self.__Fin = Fin
  def Grades(self):
      return(self.__Pre + self.__Mid + self.__Fin)/3

class Student(Person):
  def __init__(self,std1,std2,std3):
    self.__std1 = std1
    self.__std2 = std2
    self.__std3 = std3
  def Std1(self):
    print(f"{self.__std1} Student 1")
  def Std2(self):
    print(f"{self.__std2} Student 2")
  def Std3(self):
    print(f"{self.__std3} Student 3")

Prelim_1 = float(input("Student 1 Prelim Grade: "))
Midterm_1 = float (input("Student 1 Midterm Grade: "))
Finals_1 = float(input("Student 1 Finals Grade: "))
Average_1 = Person(Prelim_1, Midterm_1, Finals_1)

Prelim_2= float(input("Student 2 Prelim Grade: "))
Midterm_2 = float(input("Student 2 Midterm Grade: "))
Finals_2 = float(input("Student 2 Finals Grade: "))
Average_2 = Person(Prelim_2, Midterm_2, Finals_2)

Prelim_3 = float(input("Student 3 Prelim Grade: "))
Midterm_3 = float(input("Student 3 Midterm Grade: "))
Finals_3 = float(input("Student 3 Finals Grade: "))
Average_3 = Person(Prelim_3,Midterm_3,Finals_3)

print("\t", "\t","\t", "\t","\t","Grading Periods","\n")
print("Student Number", "\t", "\t", "Prelims","\t", "Midterm", "\t", "Finals", "\t","Average Grade")
print(student1.Std1(),"\t","\t", Prelim_1, "\t", "\t", Midterm_1, "\t","\t", Finals_1, "\t","\t", Average_1.Grades ())
print(student2.Std2(),"\t","\t", Prelim_2, "\t", "\t", Midterm_2, "\t","\t", Finals_2, "\t","\t", Average_2.Grades())
print(student3.Std3(),"\t","\t", Prelim_3, "\t", "\t", Midterm_3, "\t","\t", Finals_3, "\t","\t", Average_3.Grades (), "\n")

a="Student's Average Grade"
print("\033[1m",a,"\033[0m")
print(student1.Std1(),":   {:.2f}".format(Average_1.Grades ()))
print(student2.Std2(),":   {:.2f}". format(Average_2.Grades()))
print(student3.Std3(),":   {:.2f}".format(Average_3.Grades ()))<jupyter_output>Student 1 Prelim Grade: 1.25
Student 1 Midterm Grade: 2.50
Student 1 Finals Grade: 1.50
Student 2 Prelim Grade: 1.75
Student 2 Midterm Grade: 2.00
Student 2 Finals Grade: 2.75
Student 3 Prelim Grade: 2.00
Student 3 Midterm Grade: 3.25
Student 3 Finals Grade: 4.50
	 	 	 	 	 Grading Periods 

Student Number 	 	 Prelims 	 Midterm 	 Finals 	 Average Grade
Student 1 	 	 1.25 	 	 2.5 	 	 1.5 	 	 1.75
Student 2 	 	 1.75 	 	 2.0 	 	 2.75 	 	 2.1666666666666665
Student 3 	 	 2.0 	 	 3.25 	 	 4.5 	 	 3.25 

[1m Student's Average Grade [0m
Student 1 :   1.75
Student 2 :   2.17
Student 3 :   3.25<jupyter_text>**Application 1**   1. Create a Python program that displays the name of three students (Student 1, Student 2, and Student 3)2. Create a class name Person and attributes - std1, std2, 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>a="Student's Average Grade"
print("\033[1m", a, "\n","\033[0m")

class Person:
  def __init__(self, Pre, Mid, Fin):
    self.__Pre = Pre
    self.__Mid = Mid
    self.__Fin = Fin
  def Grades(self):
      return(self.__Pre + self.__Mid + self.__Fin)/3

class Student(Person):
  def __init__(self,std1,std2,std3):
    self.__std1 = std1
    self.__std2 = std2
    self.__std3 = std3
  def Std1(self):
    print(f"{self.__std1} Student 1")
  def Std2(self):
    print(f"{self.__std2} Student 2")
  def Std3(self):
    print(f"{self.__std3} Student 3")

Average_1 = Person(1.25,2.50,1.50)
Average_2 = Person(1.75,2.00,2.75)
Average_3 = Person(2.00,3.25,4.50)

student1.Std1()
student2.Std2()
student3.Std3()

print("\t", student1.Std1(),":   {:.2f}".format(Average_1.Grades ()))
print("\t", student2.Std2(),":   {:.2f}". format(Average_2.Grades()))
print("\t", student3.Std3(),":   {:.2f}".format(Average_3.Grades ()))<jupyter_output>[1m Student's Average Grade 
 [0m
	 Student 1 :   1.75
	 Student 2 :   2.17
	 Student 3 :   3.25
{'fraction_non_alphanumeric': 0.1588017394105331, 'fraction_numerical': 0.050410694153647934, 'mean_word_length': 4.253807106598985, 'pattern_counts': {'":': 6, '<': 20, '<?xml version=': 0, '>': 20, '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': '414469', 'license': 'Apache-2.0', 'n_tokens_mistral': 2591, 'n_tokens_neox': 2335, 'n_words': 549, 'path': 'OOP_Concepts_2.ipynb', 'repo_name': 'JustineKateAlbero/OOP-1-1', 'size': '6241'}