205k views
4 votes
1. How can repetitive code be reduced in a program?

Having variables replace functions
Replacing functions and variables
Using functions
Using variables to call a task

4.

2. Why is it more appropriate to use local variable scope as much as possible, and avoid global variable scope?


A. Local variables are easier to comment, and they compile faster.

B. Local variables are seen by any part of code, and they compile faster.

C. Local variables can make your program faster and easier to debug.

D. Local variables translate to machine code easier, and they use less memory.

3. Select the statement that is true regarding local variables.

Local variables always hold memory until the program ends.
Local variables are accessible from any function.
Local variables are usually written outside of a function.
Local variables release memory when the code is finished with them.

4. Which of the following cannot be a variable name in Python?

addre55
Phone_123
userNAME

5. hich type of variable is always stored in memory?

Global
Local
Multiple
Undefined
zip Code

1 Answer

4 votes

Answer:

i think the answer is C

Step-by-step explanation:

i just took the test and got it right but i forgot

User Faisal Syed
by
7.1k points

No related questions found