Skip to content

Abdallah-M84/OOP_Person_Class_Illustration

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 

Repository files navigation

Let's create the class Person with the specified attributes and the introduce method.

class Person:
   def __init__(self, name, age, gender):
      self.name = name
      self.age = age
      self.gender = gender

def introduce(self):
    print(f"Hello, my name is {self.name}, I am {self.age} years old, and I identify as {self.gender}.")

Creating an instance of the Person class and calling the introduce method

person = Person("Alice", 25, "female")
person.introduce()

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published