Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

plz do in python idle image text in transcribed
image text in transcribed
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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Oracle Database 19c DBA By Examples Installation And Administration

Authors: Ravinder Gupta

1st Edition

B09FC7TQJ6, 979-8469226970

More Books

Students also viewed these Databases questions

Question

Identify cultural barriers to communication.

Answered: 1 week ago