Module quiz: Programming Paradigms

Module quiz: Programming Paradigms

  1. Which of the following can be used for commenting a piece of code in Python? (Select all that apply)

    • ({ }) - Curly Brackets

    • · ( # ) - Hashtag *

    • ( @ ) - At the rate sign

    • (''' ''') - Triple quotation marks

  2. What will be the output of running the following code?

     value = 7
     class A:
         value = 5
    
     a = A()
     a.value = 3
     print(value)
    
    • 7

    • 5

    • None of the above

    • 3

  3. What will be the output of running the following code?

     bravo = 3
     b = B()
     class B:
         bravo = 5
         print("Inside class B")
     c = B()
     print(b.bravo)
    
    • 3

    • None

    • Error

    • 5

  4. Which of the following keywords allows the program to continue execution without impacting any functionality or flow?

    • continue

    • pass

    • skip

    • break

  5. Which of the following is not a measure of Algorithmic complexity?

    • Execution time

    • Logarithmic Time

    • Exponential Time

    • Constant time

  6. Which of the following are the building blocks of Procedural programming?

    • Variables and methods

    • Procedures and functions

    • All of the options.

    • Objects and Classes

  7. True or False: Pure functions can modify global variables.

    • True

    • False

  8. Which of the following is an advantage of recursion?

    • Recursion is memory efficient

    • Easy to debug

    • Recursive code can make your code look neater

    • Easier to follow