Question: If vou need to write a loop where a sentinel value indicates vou want to stop executing the loop, which statement should you use? aj

 If vou need to write a loop where a sentinel value

If vou need to write a loop where a sentinel value indicates vou want to stop executing the loop, which statement should you use? aj for c) while d) all of the above e) none of the above 8) Which of the following calculations would re quire the use of an if statement? a) A program that asks the user to enter a value and adds up the odd numbers between 1 and the entere d number (not including the entere d number) b) A program that asks the user to enter a value and adds up the even numbers between 2 and the entered number (not including the entered number) c) A program that asks a user to enter two values and adds up the even numb ers between the first entered value and the second entered value including the first entere d value but not including the second entered value d) all of the above e) none of the above 9) Which of the following statements are true? a) An if statement must have an else statement. b) An if statement must have an elif statement. c) An if statement must have both an elif and an else statement. d) An else statement must have a matching if statement. 10) When a functi on returns a value, the options for the caller are to a) ignore the return value b) use the result as part of an expression (e.g., x =y c) assign it to a variable (e.g., x-math.sqrt(5)) d) all of the above math. sqrt(5)) 11) When does the value of an actual parameter of a function change? a) Whenever the parameter is a mutable type b) Only when the parameter is a mutable type and you assign a new value to the formal parameter (i.e., the parameter is a list and you assign it to a new list such as x- [2, 3,4]) c) Only when the parameter is a mutable type and you mutate the formal parameter (i.e, append an item to a list or change the value of an item in the list such as x[01-4) d) Any change to a formal parameter affects the corresponding actual parameter 12) What variable names does a function have access to? a) All variables used in a program. b) Only variables created in the function. c) Only the parameters passed to the function. d) Parameters that are passed to the functi on and any variables created in the function

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!