#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Jan  9 09:19:04 2019

@author: hienh
"""

#################TASK1###############


class Person:
    def __init__(self,name,age,gender,pet):
        self.name = name
        self.age = age
        self.pet = pet
        if gender == 'm':
            self.isMale = True
        elif gender == 'f':
            self.isMale = False
        else:
            print("Gender not recognised!")
    
    def greetingInformal(self):
        print('Hi', self.name)
    def greetingFormal(self):
        if self.isMale:
            print('Welcome, Mr', self.name)
        else:
            print('Welcome, Ms', self.name)
 
#################TASK3####################

    def greetPet(self):
        print('you have a cute', self.pet)
            
            
#################TASK2#####################
      

p1 = Person('Tom',12,'m','cat')
print(p1.name)
p1.greetingInformal()
p1.greetPet()


#################TASK4####################

class Wizard(Person):
    
    def greetingFormal(self):
        print('Welcome, Mr', self.name, end = '')
        print("- you\'re a fine wizard!")


p1 = Wizard('Harry',12,'m','owl')
p1.greetingFormal()

#################TASK5####################

class Wizard(Person):
    def __init__(self,name,age,gender,pet):
        Person.__init__(self,name,age,'m',pet)
#################TASK6####################
    def Magic(self):
        print(self.pet, 'get me my spell book')
        
p1 = Wizard('Harry',12,'m','owl')
p1.Magic()
