Question: ues Part 1: Consider the following Python script that contains a function called 'even_odd which take the x (an integer) as the parameter and retum
ues Part 1: Consider the following Python script that contains a function called 'even_odd" which take the x (an integer) as the parameter and retum "even" if x is an even number and "odd" otherwise Answer the following questions Line 01: #This function returns Even or odd according to the integer x Line 02: def even_odd (x): Line 03: if x%2 =-0: Line 04: Line 05: else: Line 06: Line 07: Line 08: akes an integer from user and calls the function Line 09: a input ("Enter an integer:") Line 10: print a, is an", even odd (a), "number" return even" return "odd" a. At which line the computer starts execution of this script? Points 2 Line o3 Find one example for each of the following terms from the above Python script Keyword Built-in function Function name Function call Parameter Argument Local variable b. c. What will be the output of this script for the following user input? Output of the script even 3 d. Which of the followings are valid function call(s) to the function even_odd? (Note: There may be more than one answer.) i. even odd(s) ii. even _odd (len("Hello World") ) even odd (-5) v. even odd (2,3) v. even_odd (2+3) Part 2: Suppose the two return statements in even odd fu above(Note: Your answer may contains any number of lines) nction are changed to two print mas. Then, how would you change Line 10 to get the same output as
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
