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:

  1. 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.
  2. 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):

  1. 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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!