Learn practical skills, build real-world projects, and advance your career

Question 1:

Create a function that can accept two arguments name and age and print its value

def func(name, age):
    print('name= ',name)
    print('age= ',age)
func('ali',  33)
name= ali age= 33

Question 2:

Write a function func1() such that it can accept a variable length of argument and print all arguments value

def func1(*args):
func1('hello', 'hi', 23, '2383')
hello hi 23 2383

Question 3:

Write a function calculation() such that it can accept two variables and calculate the addition and subtraction of it. And also it must return both addition and subtraction in a single return call