<jupyter_start><jupyter_text>Python Classes and Objects Create classes<jupyter_code>class MyClass:
  pass
class OOP1_2:
  x=5
  print(x)<jupyter_output>5<jupyter_text>Create Objects<jupyter_code>class OOP1_2:
  def __init__(self,name,age):  #__init__()
      self.name = name          #attributes
      self.age = age

  def identity(self):
    print(self.name,self.age)

person = OOP1_2("Ryu", 19)      #create objects

print(person.identity)
print(person.name)
print(person.age)
#Modify the Object Name

person.name = "Yong"
person.age = 24
print(person.name)
print(person.age)
#Delete the Object

del person.name
print(person.name)<jupyter_output><empty_output><jupyter_text>Application 1 - Write a Python program that computes the area of a square, and name its class as Square, side as attribute.<jupyter_code>class Square:
  def __init__(self,sides):
    self.sides = sides
    
  def area(self):
    return self.sides*self.sides      #formula to compute the area of the square

  def display(self):
    print("the area of the square is:", self.area())

square = Square(4)

print(square.sides)
square.display()<jupyter_output>4
the area of the square is: 16<jupyter_text>Application 2 - Write a Python program that displays your full name, age, course, school. Create a class names MyClass, and name, age, school as attributes<jupyter_code>class MyClass:
  def __init__(self,name,age,course,school):
    self.name = name
    self.age = age
    self.course = course
    self.school = school

  def identity(self):
    print(self.name,self.age,self.course,self.school)

collegestudent = MyClass("<NAME>",19,"Bachelor of Science in Computer Engineering","Cavite State Univeristy")

print(collegestudent.identity)

print(collegestudent.name)
print(collegestudent.age)
print(collegestudent.course)
print(collegestudent.school)<jupyter_output><bound method MyClass.identity of <__main__.MyClass object at 0x7fa09b5d5c50>>
<NAME>
19
Bachelor of Science in Computer Engineering
Cavite State Univeristy
{'fraction_non_alphanumeric': 0.10105052526263132, 'fraction_numerical': 0.015007503751875938, 'mean_word_length': 4.9880239520958085, 'pattern_counts': {'":': 0, '<': 18, '<?xml version=': 0, '>': 18, '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': '4', 'dir': 'jupyter-structured-clean-dedup', 'id': '495849', 'license': 'Apache-2.0', 'n_tokens_mistral': 702, 'n_tokens_neox': 673, 'n_words': 177, 'path': 'OOP_Concepts.ipynb', 'repo_name': 'Itto-ryu/CPEN-21A-CPE-1-2', 'size': '2013'}