Which of the following options are true regarding these two code samples?
Code sample 1:
def main():
for i in xrange(10**8):
pass
main()
Code sample 2:
for i in xrange(10**8):
pass
Correct Answer: Code sample 2 would take a longer time to complete than code sample 1. This is because in code sample 1, 'i' is local, whereas in code sample 2 it is global.
Explanation:
Note: This Question is unanswered, help us to find answer for this one
More Python MCQ Questions