Skip to content
IT-605 · Programming in Python/Important Questions

Programming in Python (IT-605) - Important Questions

  1. Unit 37 Marks High Priority

    Explain the rules for naming Python identifiers. Give at least five examples of valid identifiers and five examples of invalid identifiers with brief explanations for each.

    Core topic in Unit 3; directly tests knowledge of identifier formation rules (frequently asked).

  2. Unit 310 Marks Medium Priority

    Write a Python program that reads a string from input and determines whether it is a valid Python identifier. Use appropriate standard library features (for example, $str.isidentifier()$) and display clear messages for valid and invalid cases.

    Practical programming task assessing use of built-in string/identifier utilities; commonly used in practical examinations.

  3. Unit 37 Marks Medium Priority

    Differentiate between Python identifiers and Python keywords. Show how to list all Python keywords programmatically and provide examples where a keyword cannot be used as an identifier.

    Conceptual differentiation often asked to test understanding of reserved words versus user-defined names.

  4. Unit 310 Marks High Priority

    Explain the significance of leading and trailing underscores in Python identifiers: single leading underscore (e.g. $_var$), single trailing underscore (e.g. $var\_$), double leading underscores (e.g. $__var$) and double leading and trailing underscores (e.g. $__init__$). Illustrate with examples showing name mangling and the use of special ("dunder") methods.

    Core conceptual question about special identifier forms (single/double underscores) and name mangling; appears frequently in exams testing advanced identifier behavior.

  5. Unit 37 Marks Medium Priority

    Describe PEP 8 naming conventions for Python identifiers. Explain recommended styles for variables, functions, classes, constants, and modules and why following these conventions is important.

    Style and best-practice question derived from naming conventions (important for readable code).

  6. Unit 35 Marks Medium Priority

    Are Python identifiers case-sensitive? Explain with concise examples that demonstrate different identifiers differing only in case and their behavior.

    Basic property of identifiers; checks understanding of case sensitivity.

  7. Unit 35 Marks Medium Priority

    Discuss whether Python identifiers may contain Unicode characters. Explain the rules, give examples of Unicode identifiers, and describe potential issues when using non-ASCII identifiers in source code.

    Advanced/modern topic about Unicode in identifiers; relevant due to evolving language features.

  8. Unit 310 Marks Medium Priority

    Trace the output of the following code and explain each line of output with reference to identifier resolution and name mangling:

    class A: def init(self): self.__x = 10

    def get_x(self):
        return self.__x
    

    obj = A() print(obj.get_x()) print(hasattr(obj, '_A__x')) print(getattr(obj, '_A__x'))

    Applied tracing question combining identifiers and name-mangling scope behavior; representative of exam-style tracing problems.

Go to where you left off?

Quick Add to Notes

Save questions, your own notes and screenshots into notes filed by unit. It takes a free account.

Create free account

Have an account? Log in