From 9b9828229eb1d6789de7d989f376dcf9b635d591 Mon Sep 17 00:00:00 2001 From: Spencerscooper Date: Sat, 8 Jul 2023 12:51:45 +0000 Subject: [PATCH] learning class and method --- Method-Class/Method.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 Method-Class/Method.py diff --git a/Method-Class/Method.py b/Method-Class/Method.py new file mode 100644 index 0000000..2818fa2 --- /dev/null +++ b/Method-Class/Method.py @@ -0,0 +1,18 @@ +class Student: + def __init__ (self,f,m,l): + self.first_name = f + self.middle_name = m + self.last_name = l + + def person (self): + self.individual = self.first_name + self.middle_name + self.last_name + return self.individual + + +Studentsname1 = Student("Spencer"," Cooper "," Galaxy") +Studentsname2 = Student("Thomas", "T", " Boimah") +Studentsname3 = Student("Freena", " Y", " Koikoi") +print("Welcome Student", Studentsname1.person()) +print("Welcome Student", Studentsname2.person()) +print("Welcome Student", Studentsname3.person()) +