Function Call
Function Call
Function Call
📌 Write a function greet() that prints "Hello, welcome!" when called. Then, call the
function.
📌 Write a function multiply(a, b) that takes two numbers as parameters and prints
their product. Call the function with values 4 and 5.
📌 Write a function divide(x, y) that takes two numbers as input, divides them, and
returns the result. Call the function with 10 and 2, store the result in a variable, and
print it.
📌 Write a function show_message() that prints "Python is fun!" and call the function.
📌 Write a function subtract(a, b) that takes two numbers and returns their difference.
Call the function with 15 and 7, store the result, and print it.
📌 Write a function calculate(a, b) that returns both the sum and product of two
numbers. Call the function with 3 and 4, then print both results.
📌 Write a function is_positive(n) that returns "Positive" if the number is greater than 0,
"Negative" if less than 0, and "Zero" otherwise. Call with -5 and print the result.
9. Function Combining Everything
📌 Write a function check_grade(marks) that:
Takes marks as input.
Returns "Pass" if marks >= 50, else returns "Fail".
If marks are 90 or above, also print "Excellent!".
Call the function with 95 and print the result.