[Tutor] Why is this printing None?

Cranky Frankie cranky.frankie at gmail.com
Wed Apr 15 09:24:14 EDT 2020


I have this simple class in Python 3.8. When I run this in IDLE or at the
command prompt the word None gets printed after the employee name. Why?

class Employee:

    def __init__ (self, name):
        self.name = name

    def displayEmployee(self):
        print("Name : ", self.name)

if __name__ == '__main__':
    emp1 = Employee('Zara')
    print(emp1.displayEmployee())



Frank L. "Cranky Frankie" Palmeri, Risible Riding Raconteur & Writer
WORK Hard - PLAY Hard - READ Hard - THINK Hard


More information about the Tutor mailing list