<jupyter_start><jupyter_text>Create a Class<jupyter_code>class MyClass:
  pass            #to create a class without method
class MyClass:  #the name of the class
  x=40          #property of the class named MyClass

p1= MyClass()
print(p1.x)
class Car():                 #create a class
  def __init__(self,name,color):
    self.name = name         #represents the instance of class named car
    self.color = color

  def description(self):
    return self.name, self.color

  def display(self):
    print("The name and color of the car",self.description())

obj1 = Car("Honda","black")  #to create an object with its attribute value
obj1.display()<jupyter_output>The name and color of the car ('Honda', 'black')<jupyter_text>Modify an Object Property<jupyter_code>obj1.name = "Mitsubishi"
print(obj1.name)
obj1.display()<jupyter_output>The name and color of the car ('Mitsubishi', 'black')<jupyter_text>Delete the Object Property<jupyter_code>class Car():                 #create a class
  def __init__(self,name,color):
    self.name = name         #represents the instance of class named car
    self.color = color

  def description(self):
    return self.name, self.color

  def display(self):
    print("The name and color of the car",self.description())

obj1 = Car("Honda","black")  #to create an object with its attribute value
obj1.display()
del obj1
obj1.display()


obj2 = Car("BMW","red")
obj2.display()<jupyter_output>The name and color of the car ('BMW', 'red')<jupyter_text>Application 1 - Write a python program to compute the are and the perimeter of a rectangle. Using Rectangle as class name and length and width as attributes<jupyter_code>class Rectangle():
  def __init__(self, length, width):
    self.length = length
    self. width= width

  def Area(self):
    return self.length, self.width

  def Perimeter(self):
    return 2*(self.length+self.width)

  def display(self):
    print("The length and width is",self.Area())
    print("the perimeter of the rectangle is",self.Perimeter())

pol = Rectangle(7,4.5)
pol.display()<jupyter_output>The length and width is (7, 4.5)
the perimeter of the rectangle is 23.0<jupyter_text>Application 2 - Write a python program to display a class name OOP_58001 with your student no. and fullname (Surname, First Name) as attributes<jupyter_code>class OOP_58001:
  pass
class OOP_58001():
  def __init__(self,studentnum, lastname, firstname):
    self.studentnum = studentnum
    self.lastname= lastname
    self.firstname = firstname

  def name(self):
    return self.lastname + self.firstname + self.studentnum

  def studentnumber(self):
    print("I am", self.name())

name = OOP_58001("202114719 ", "Andres ", "<NAME> ")
name.studentnumber()<jupyter_output>I am <NAME> 202114719
{'fraction_non_alphanumeric': 0.10690909090909091, 'fraction_numerical': 0.023636363636363636, 'mean_word_length': 4.113382899628252, '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': '5', 'dir': 'jupyter-structured-clean-dedup', 'id': '70039', 'license': 'Apache-2.0', 'n_tokens_mistral': 915, 'n_tokens_neox': 870, 'n_words': 281, 'path': 'OOP_in_Python.ipynb', 'repo_name': 'Krystiandres/OOP-58001', 'size': '2773'}