1. When creating your own functions, which of the following are good characteristics that make them...

70.2K

Verified Solution

Question

Programming

1. When creating your own functions, which of the following aregood characteristics that make them robust, sharable, and reusable(check all that apply)

the function's name is suggestive of its purpose and/or actionsand includes a summary docstring

the function freely uses variables in the global namespace toperform its activities

the function only uses variables it is passed by calling code orit otherwise internally creates

the function only performs a limited number of actions

2. Following list is given.

L L = [20, ‘Hello’, ‘Hi’, 6, 9]

What is the type of L[-3] = ?

int

float

string

list

3. Functions are required to have the following number ofparameters and return statements (check all that apply):

at least one parameter and one return statement

zero or more parameters and zero or more return statements

one parameter but zero or more return statements

one return statement but zero or more parameters

4. To repeat a code fixed number of times what should youuse?

while loop

repeat loop

for loop

conditional structure

5. What is the value of 'total' at the end of the code?

total = 0
numbers = [11, 1, -1, -20, 15]
for number in numbers: 
total += number

Raise an error

10

6

16

Answer & Explanation Solved by verified expert
4.4 Ratings (604 Votes)
Ans 1 Some good characterstics of user defined functions are Option a the functions name should be suggestive of its purpose andor actions which helps in better readability of code Option b The global variables should be avoided in good coding practices but it can be used if necessary Option c The functions should use the variables passed as arguments or should create its own variables as it helps in sharing    See Answer
Get Answers to Unlimited Questions

Join us to gain access to millions of questions and expert answers. Enjoy exclusive benefits tailored just for you!

Membership Benefits:
  • Unlimited Question Access with detailed Answers
  • Zin AI - 3 Million Words
  • 10 Dall-E 3 Images
  • 20 Plot Generations
  • Conversation with Dialogue Memory
  • No Ads, Ever!
  • Access to Our Best AI Platform: Flex AI - Your personal assistant for all your inquiries!
Become a Member

Other questions asked by students