Answer True or False each questions.(Computer Science, Python) 1. A function can
ID: 3700890 • Letter: A
Question
Answer True or False each questions.(Computer Science, Python)
1. A function can be called before being defined
2. A function that has no return statements returns a value of False
3. A function continues to execute lines after the return statement is encountered
4. Tuples and Lists work the same with slicing as strings.
5. List, String and tuple indexing starts at index -1
6. The main program can call a function, but functions may not call other functions.
7. Reuse is one of the reasons for using functions in your program.
8. A Function should only do one thing.
Explanation / Answer
1. False. a function can't be called without defining it.
2. False, a function that has no return statement doesn't return anything
3. False, a function execution stops when a return statement is encountered
4. True. Slicing can be done on tuples and lists the same way as on strings
5. False. Indexing in python starts with 0.
6. False. Any function can call any other function in python
7. True. We define functions so that we can re use them.
8. True. Ideally a function should do one thing in python
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.