Here is a fragment of a program that uses this function


Consider this very simple function: def cube(x): answer = x * x * x return answer

(a) What does this function do?

(b) Show how a program could use this function to print the value of y 3 , assuming y is a variable.

(c) Here is a fragment of a program that uses this function: answer = 4 result = cube(3) print answer, result The output from this fragment is 4 27. Explain why the output is not 27 27, even though cube seems to change the value of answer to 27.

Request for Solution File

Ask an Expert for Answer!!
Data Structure & Algorithms: Here is a fragment of a program that uses this function
Reference No:- TGS01283095

Expected delivery within 24 Hours