create a basic class in python code example

Example 1: python class

class Animal(object): # Doesn't need params but put it there anyways.
    def __init__(self, species, price):
        self.species = species # Sets species name
        self.price = price # Sets price of it
    
    def overview(self): # A function that uses the params of the __init__ function
        print(f"This species is called a {self.species} and the price for it is {self.price}")

class Fish(Animal): # Inherits from Animal
    pass # Don't need to add anything because it's inherited everything from Animal
 
salmon = Fish("Salmon", "$20") # Make a object from class Fish
salmon.overview() # Run a function with it
dog = Animal("Golden retriever", "$400") # Make a object from class Animal
dog.overview() # Run a function with it

Example 2: how to define a class in python

class a_class:
  #This initalizes the object, and is executed when you define
  #a new object in the class
  def __init__(self, input1):
    self.__input1 = input1
    
  #This is a function of the object that can be called
  def return_input(self):
    return self.__input1
  
a_class_object = a_class("input string")
print(a_class_object.return_input())