0
Python-how can I call the function with keyword arguments?
Exercise #1 Create a function show_employee() in such a way that it should accept employee name, and its salary and display both. If the salary is missing in the function call assign default value 50000 to salary. Call this function 3 times: with keyword arguments with 2 positional arguments with 1 positional argument You can use any values for arguments. As a result, you should have the function definition and 3 function calls. def show_employee(name, salary=50000): print("Employee", name, "salary is:", salary) show_employee("Ben", 50000) show_employee("Ben")
1 Respuesta
+ 1
hi Natalia Staver - your print statement needs to be indented. example below:
def show_employee(name, salary=50000):
print(“something”)
as a reminder, indentations are very important in python.