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.

INT108 viva questions Python Programming

60 questions across 6 units, with answers. Say your answer out loud first, then check it.

All INT108 material

  1. Question 1 of 60Unit 1, Python VersionsEasy

    What is the primary difference between Python 2 and Python 3 mentioned in the syllabus regarding backward compatibility?

  2. Question 2 of 60Unit 1, Environment SetupMedium

    Why is it critical to check 'Add Python to PATH' during installation on Windows?

  3. Question 3 of 60Unit 1, VariablesEasy

    Explain the concept of Dynamic Typing in Python.

  4. Question 4 of 60Unit 1, Variable NamingEasy

    List three rules for naming variables in Python.

  5. Question 5 of 60Unit 1, OperatorsMedium

    What is the difference between the / operator and the // operator?

  6. Question 6 of 60Unit 1, String OperationsMedium

    How does the * operator function when applied to a string?

  7. Question 7 of 60Unit 1, ErrorsEasy

    What causes a NameError in Python?

  8. Question 8 of 60Unit 1, Order of OperationsMedium

    Explain the PEMDAS rule in Python expression evaluation.

  9. Question 9 of 60Unit 1, CompositionHard

    What is 'Composition' in the context of Python statements?

  10. Question 10 of 60Unit 1, CommentsEasy

    How do you denote a single-line comment versus a multi-line comment in Python?

  11. Question 11 of 60Unit 2, The Modulus OperatorMedium

    What are two common use cases for the Modulus operator (%)?

  12. Question 12 of 60Unit 2, Random NumbersEasy

    What does random.random() return compared to random.randint(a, b)?

  13. Question 13 of 60Unit 2, Logic OperatorsHard

    Explain 'Short-circuit evaluation' in Python logical operators.

  14. Question 14 of 60Unit 2, Boolean ExpressionsEasy

    What is the difference between = and ==?

  15. Question 15 of 60Unit 2, Conditional StatementsMedium

    When would you use elif instead of a nested else: if structure?

  16. Question 16 of 60Unit 2, While LoopsMedium

    Why is a while loop called 'indefinite iteration'?

  17. Question 17 of 60Unit 2, Loop ControlMedium

    Differentiate between break and continue.

  18. Question 18 of 60Unit 2, For LoopsMedium

    What sequence does range(2, 10, 2) generate?

  19. Question 19 of 60Unit 2, EncapsulationHard

    How does Encapsulation improve code quality in the context of loops?

  20. Question 20 of 60Unit 2, GeneralizationHard

    What is Generalization in programming functions?

  21. Question 21 of 60Unit 3, Function TypesEasy

    What is the difference between a Fruitful function and a Void function?

  22. Question 22 of 60Unit 3, Type ConversionMedium

    Explain the difference between Type Coercion and Type Casting.

  23. Question 23 of 60Unit 3, Math FunctionsEasy

    What does math.ceil(4.2) return and why?

  24. Question 24 of 60Unit 3, Variable ScopeMedium

    What is the scope of a 'Local Variable'?

  25. Question 25 of 60Unit 3, Parameters vs ArgumentsMedium

    Technically, how do Parameters differ from Arguments?

  26. Question 26 of 60Unit 3, Argument TypesMedium

    How do Keyword Arguments differ from Positional Arguments?

  27. Question 27 of 60Unit 3, Arbitrary ArgumentsHard

    When would you use *args in a function definition?

  28. Question 28 of 60Unit 3, RecursionHard

    What are the two mandatory parts of a recursive function to avoid infinite loops?

  29. Question 29 of 60Unit 3, Recursion MemoryHard

    What is a limitation of using recursion regarding memory?

  30. Question 30 of 60Unit 3, Flow of ExecutionMedium

    Describe the flow of execution when a function is called.

  31. Question 31 of 60Unit 4, String ImmutabilityMedium

    What does it mean that strings are 'immutable' in Python?

  32. Question 32 of 60Unit 4, SlicingMedium

    In the slice s[start:stop], is the stop index inclusive or exclusive?

  33. Question 33 of 60Unit 4, Lists vs TuplesEasy

    What is the primary difference between a List and a Tuple?

  34. Question 34 of 60Unit 4, List DeletionMedium

    How does pop() differ from remove() in lists?

  35. Question 35 of 60Unit 4, Tuple AssignmentMedium

    How can you swap values of two variables a and b using tuple assignment?

  36. Question 36 of 60Unit 4, Dictionary BasicsEasy

    What are the requirements for keys in a Python dictionary?

  37. Question 37 of 60Unit 4, Dictionary MethodsMedium

    Why would you use the get() method instead of bracket notation dict[key]?

  38. Question 38 of 60Unit 4, Sparse MatricesHard

    How can dictionaries be used to represent sparse matrices efficiently?

  39. Question 39 of 60Unit 4, AliasingHard

    What is Aliasing in the context of lists?

  40. Question 40 of 60Unit 4, CopyingHard

    What is the difference between a Shallow Copy and a Deep Copy?

  41. Question 41 of 60Unit 5, OOP ConceptsEasy

    Define 'Class' and 'Object'.

  42. Question 42 of 60Unit 5, ConstructorsMedium

    What is the purpose of the __init__ method?

  43. Question 43 of 60Unit 5, The self ParameterMedium

    What does self represent in a Python class method?

  44. Question 44 of 60Unit 5, InheritanceEasy

    What is Class Inheritance?

  45. Question 45 of 60Unit 5, Method OverridingMedium

    What is Method Overriding?

  46. Question 46 of 60Unit 5, Super FunctionHard

    What is the use of the super() function in inheritance?

  47. Question 47 of 60Unit 5, EncapsulationMedium

    How do you denote a 'Private' attribute in Python, and what does it do?

  48. Question 48 of 60Unit 5, Name ManglingHard

    Can private attributes be accessed at all? If so, how?

  49. Question 49 of 60Unit 5, Function OverloadingMedium

    Does Python support traditional function overloading? How is it handled?

  50. Question 50 of 60Unit 5, AttributesEasy

    What is the difference between Class Attributes and Instance Attributes?

  51. Question 51 of 60Unit 6, File ModesEasy

    What is the difference between 'w' and 'a' modes in file handling?

  52. Question 52 of 60Unit 6, Context ManagersMedium

    Why is it best practice to use the with statement when opening files?

  53. Question 53 of 60Unit 6, Reading FilesMedium

    What is the difference between read() and readlines()?

  54. Question 54 of 60Unit 6, Writing FilesEasy

    Can you pass an integer directly to the file.write() method?

  55. Question 55 of 60Unit 6, SerializationHard

    What is 'Pickling' in Python?

  56. Question 56 of 60Unit 6, Exception HandlingMedium

    What is the purpose of the try...except block?

  57. Question 57 of 60Unit 6, The Else BlockMedium

    When does the else block execute in a try...except...else structure?

  58. Question 58 of 60Unit 6, Regular ExpressionsEasy

    What do the metacharacters . and ^ represent in Regex?

  59. Question 59 of 60Unit 6, Regex FunctionsMedium

    How does re.match() differ from re.findall()?

  60. Question 60 of 60Unit 6, Regex Special SequencesMedium

    What do \d and \w match in a Regular Expression?

That's the set

Go back over the ones you couldn't answer without looking. The unit notes cover each topic in full.