def employee(emp_num, name, emprole):
print(emp_num, name, emprole)
employee(1, 'John', 'Manager')
employee(2, 'Tim', 'CFO')
print('')
employee(1, 'Phil', 'Manager')
print('')
def student(firstname, lastname='Mark', standard='Fifth'):
print(firstname, lastname, 'studies in', standard, 'Standard')
# 1 positional argument
student('John')
# 3 positional arguments
student('Bill', 'Gates', 'Seventh')
student('Tim', 'Cook', 'Seventh')
# 2 positional arguments
student('Bill', 'Gates')
student('Bill', 'Cook')
print('')
# A required argument is required
def greeting(phrase):
print(phrase)
return;
print('Not passing required argument')
greeting('hello')
print('')
1 John Manager
2 Tim CFO
1 Phil Manager
John Mark studies in Fifth Standard
Bill Gates studies in Seventh Standard
Tim Cook studies in Seventh Standard
Bill Gates studies in Fifth Standard
Bill Cook studies in Fifth Standard
Not passing required argument
hello