Factorial Loop Body Error
 1) In while loop, the iteration statement can be written within any point inside the loop. True False

 2) “in” is ----- kind of operator in python. Bitwise operator Identity operator Membership operator Comparison operator

 3) Which of the following is the correct extension of the Python file? .py .p .python .pl

 4) What is the purpose of a factorial loop? To calculate the difference between two given numbers To calculate the product of all integers from 1 up to a given number To calculate the total number of items in a list To calculate the sum of all integers from 1 up to a given number

 5) What is the most likely cause of a factorial loop body error? Incorrectly coding the loop termination Incorrectly coding the loop body Incorrectly coding the loop initialization Incorrectly coding the loop condition

 6) What should be done to fix a factorial loop body error? Check the loop condition for errors and correct them Check the loop body for errors and correct them Check the loop initialization for errors and correct them Check the loop termination for errors and correct them

 7) What is the most likely cause of a factorial loop body error when using a "for" loop? Forgetting to assign a value to the loop counter Forgetting to increment the loop counter Forgetting to initialize the loop counter Forgetting to declare the loop counter

 8) What will be the output of the following source code? num = 5 fact = 1 i = 1 while i = num:   fact = fact + i   i = i + 1 print(fact) Memory fragmentation error 16 Syntax error Compilation error

 9) What will be the output of the following source code? def factorial(n):   if n == 0:     return 1   else:    return n * factorial(n-1) result = factorial(5) print(result) The code will execute without any errors and print the correct factorial of 5 The code contains a logical error and will result in an infinite loop The code has a error due to an incorrect base case The code has a syntax error in the return statement

 10) What will be the output of the following source code? num = 5 fact = 1 i = 1 while i <= num:   fact = fact - i   i = i + 1 print(fact) -14 14 5 -5