Question: Complete the following exercises using Python and your chosen IDE. Take screenshots of the code and its output where specified and paste them into in
Complete the following exercises using Python and your chosen IDE. Take screenshots of the code and its output where specified and paste them into in a well-labeled Word document for submission.
Exercise 1: Define and Call Functions
Do the following:
- Write a program in which you write a function named value_squared. The function should accept an argument and display the squared value of the argument.
- Look at this function header and write a statement that will call this function, passing 20 as an argument.
Note: you need to add code to complete the function: def show_value(quantity):
- Imagine a program has the following function definition.Write a statement that passes the value 3 to this function and assigns its return value to a variable called cube-result and displays cube_result to the screen.
def cube (val): return val * val * val
Take screenshots of the code and output for all three exercises.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
