Question: plz do in python idle Task 1: Creating Simple Functions 1. Open a new Python file and name it functions_intro.py. 2. Write a function called

Task 1: Creating Simple Functions 1. Open a new Python file and name it "functions_intro.py". 2. Write a function called greet_user ( ) that prints the message "Hello, new programmer!" 3. Call the greet_user ( ) function to see the message displayed. Task 2: Function with Parameters 1. Extend your existing program by creating a new function called greet_name ( ) and copying the contents of your existing greet_user() function into it. 2. Modify the greet_name ( ) function to accept a parameter called name. 3. Update the function to print a customized greeting like "Hello, [name]!" (Replace [name] with the provided name). 4. Call the greet_name ( ) function with your name as an argument. Task 3: Function with Return Value 1. Create a function called add_numbers (a, b) that takes two parameters, a and b. 2. Inside the function, calculate the sum of a and b and store it in a variable called result. 3. Return the result from the function. 4. Call the add_numbers ( ) function with two numbers of your choice and print the returned value. Task 4: Function Call Inside a Function 1. Create a function called multiply_numbers (x,y) that takes two parameters, x and y. 2. Inside the function, call the add_numbers ( ) function with x and y as arguments and store the result in a variable called product. 3. Return the product from the multiply_numbers ( ) function. 4. Call the multiply_numbers () function with two numbers of your choice and print the returned value
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
