Notice: Due to an ongoing migration of our storage and publishing system, material requested since last month will not be uploaded for the time being, and new requests are paused. All existing notes remain available.

Unit 1 subjective questions Python basics

ECAP776 20 questions with model answers. Write yours first, then compare.

Read the notes Practice MCQs
  1. Question 1 of 20

    Define Python and explain its major features and applications.

  2. Question 2 of 20

    Explain how a Python program is executed. Distinguish between interactive mode and script mode.

  3. Question 3 of 20

    What are identifiers, keywords, variables, and literals in Python? State the rules for naming identifiers.

  4. Question 4 of 20

    Describe Python's basic built-in data types with suitable examples.

  5. Question 5 of 20

    Distinguish between mutable and immutable data types in Python. Explain the distinction using examples.

  6. Question 6 of 20

    Explain implicit and explicit type conversion in Python. Illustrate both with examples and mention possible conversion errors.

  7. Question 7 of 20

    Classify and explain the operators available in Python with suitable examples.

  8. Question 8 of 20

    Explain operator precedence and associativity in Python. Evaluate the expression 2 + 3 * 4 ** 2 // 8 - 1 step by step.

  9. Question 9 of 20

    Compare the /, //, %, and ** operators in Python. Explain how floor division and remainder are related.

  10. Question 10 of 20

    Differentiate between equality, identity, and membership operations in Python.

  11. Question 11 of 20

    Explain simple if, if-else, and if-elif-else statements in Python. Why is indentation significant?

  12. Question 12 of 20

    Describe nested conditional statements and logical operators. Write the logic for determining whether a given year is a leap year.

  13. Question 13 of 20

    Explain the while loop in Python. Write and trace a program that calculates the sum of the first natural numbers.

  14. Question 14 of 20

    Explain the for loop and the range() function. Compare for and while loops with examples of suitable use cases.

  15. Question 15 of 20

    Describe the purpose of break, continue, and pass in Python. How does the optional else clause of a loop behave?

  16. Question 16 of 20

    What is a function in Python? Explain function definition, function call, parameters, arguments, and return values.

  17. Question 17 of 20

    Compare positional, keyword, default, and variable-length arguments in Python functions.

  18. Question 18 of 20

    Explain local, global, and nonlocal scope in Python using the LEGB name-resolution rule.

  19. Question 19 of 20

    Define recursion. Explain how a recursive factorial function works, including its base case and recursive case.

  20. Question 20 of 20

    Explain lambda expressions and distinguish them from functions defined with def. Also describe the role of docstrings.

That's unit 1

Long answers stick best when they're tested again soon. Run the MCQs on this unit, then come back to the questions you found hardest.