100+ Python Output MCQs Questions | Skillup Coding by MCQs

Here are 100 output-based multiple-choice questions (MCQs) covering various levels and topics in Python programming. The answers are provided at the end in a table format.


Basic Python Concepts

1. What will be the output of the following code?

print(“Hello, World!”)

  • A) Hello World
  • B) Hello, World!
  • C) Hello
  • D) None

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

print(“Python”[0])

  • A) P
  • B) y
  • C) t
  • D) None

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

x = 5

y = 3

print(x / y)

  • A) 1.666
  • B) 1
  • C) 15
  • D) 5

4. What will be the output of this code?

x = 2

y = 4

print(x ** y)

  • A) 6
  • B) 16
  • C) 8
  • D) 4

5. What will be the output of the following code?

x = [1, 2, 3]

x[0] = 10

print(x)

  • A) [1, 2, 3]
  • B) [10, 2, 3]
  • C) [1, 10, 3]
  • D) None

6. What is the output of the following code?

x = “Python”

print(x[2:5])

  • A) t
  • B) Pyt
  • C) tho
  • D) yth

7. What is the output of this code?

x = [1, 2, 3]

x.append(4)

print(x)

  • A) [1, 2, 3]
  • B) [1, 2, 3, 4]
  • C) [4, 1, 2, 3]
  • D) None

8. What will be printed when you run this code?

x = 10

y = “5”

print(x + int(y))

  • A) 15
  • B) 105
  • C) 5
  • D) Error

9. What will be the output of this code?

print(type(10))

  • A) <class ‘int’>
  • B) <class ‘str’>
  • C) <class ‘float’>
  • D) <class ‘list’>

10. What is the output of the following code?

x = 10

y = 3

print(x // y)

  • A) 3
  • B) 3.333
  • C) 7
  • D) 0

Intermediate Python Concepts

11. What will be the output of this code?

x = [1, 2, 3, 4]

print(x[1:3])

  • A) [1, 2]
  • B) [2, 3]
  • C) [3, 4]
  • D) [1, 3]

12. What will the following code output?

def multiply(x, y):

    return x * y

print(multiply(2, 3))

  • A) 6
  • B) 5
  • C) 23
  • D) None

13. What will be printed by the following code?

x = 4

y = 3

if x > y:

    print(“x is greater”)

else:

    print(“y is greater”)

  • A) x is greater
  • B) y is greater
  • C) Error
  • D) None

14. What will be the output of this code?

def greeting(name):

    print(“Hello ” + name)

greeting(“Alice”)

  • A) Hello Alice
  • B) greeting Alice
  • C) Alice
  • D) None

15. What is the output of the following code?

x = “apple”

print(x[::-1])

  • A) elppa
  • B) apple
  • C) Error
  • D) None

16. What will the following code print?

x = 10

y = 20

z = 30

print(x + y * z)

  • A) 600
  • B) 650
  • C) 30
  • D) 400

17. What will be the output of the following code?

def foo(x, y=5):

    return x * y

print(foo(3))

  • A) 15
  • B) 8
  • C) 5
  • D) 3

18. What is the result of this code?

x = [1, 2, 3]

x.pop(1)

print(x)

  • A) [1, 3]
  • B) [2, 3]
  • C) [1, 2]
  • D) [3]

19. What will the following code print?

x = {1, 2, 3}

x.add(4)

print(x)

  • A) {1, 2, 3}
  • B) {1, 2, 3, 4}
  • C) {4, 1, 2, 3}
  • D) None

20. What will be printed by the following code?

x = [1, 2, 3, 4]

x.remove(3)

print(x)

  • A) [1, 2, 3, 4]
  • B) [1, 2, 4]
  • C) [3, 4]
  • D) [2, 3, 4]

Advanced Python Concepts

21. What will be the output of the following code?

x = 5

y = 10

print(x == y)

  • A) True
  • B) False
  • C) Error
  • D) None

22. What is the result of running this code?

x = [1, 2, 3]

y = x

y[0] = 10

print(x)

  • A) [1, 2, 3]
  • B) [10, 2, 3]
  • C) [1, 2, 10]
  • D) None

23. What will be printed by the following code?

try:

    print(1 / 0)

except ZeroDivisionError:

    print(“Division by zero”)

  • A) Division by zero
  • B) Error: ZeroDivisionError
  • C) None
  • D) 1

24. What is the output of this code?

x = {“name”: “Alice”, “age”: 25}

print(x[“age”])

  • A) Alice
  • B) 25
  • C) name
  • D) Error

25. What will the following code output?

x = “123”

print(int(x) + 1)

  • A) 124
  • B) 1231
  • C) 1241
  • D) None

26. What is the result of the following code?

x = {1, 2, 3, 4}

x.remove(2)

print(x)

  • A) {1, 2, 3, 4}
  • B) {1, 3, 4}
  • C) {2, 3, 4}
  • D) Error

27. What will this code output?

def outer():

    x = 5

    def inner():

        print(x)

    inner()

outer()

  • A) 5
  • B) Error
  • C) None
  • D) inner

28. What is the output of the following code?

x = [1, 2, 3, 4]

print(x[::2])

  • A) [1, 2, 3]
  • B) [1, 3]
  • C) [2, 4]
  • D) [4, 3, 2, 1]

29. What is the output of this code?

x = {1, 2, 3}

x.add(4)

print(len(x))

  • A) 3
  • B) 4
  • C) 5
  • D) 2

30. What will be printed by this code?

x = [“a”, “b”, “c”]

print(x[1])

  • A) a
  • B) b
  • C) c
  • D) None

Additional Python Concepts

31. What will be printed by the following code?

x = (1, 2, 3)

print(type(x))

  • A) <class ‘tuple’>
  • B) <class ‘list’>
  • C)

<class ‘dict’>

  • D) <class ‘set’>

32. What will this code output?

x = “Python”

print(x.find(“t”))

  • A) 1
  • B) 2
  • C) 3
  • D) None

33. What will be the result of the following code?

x = “Python”

print(x.upper())

  • A) PYTHON
  • B) python
  • C) None
  • D) Error

34. What is the output of this code?

def multiply(x, y):

    return x * y

print(multiply(4, 2))

  • A) 8
  • B) 6
  • C) 24
  • D) None

35. What is the result of the following code?

x = {“apple”: 1, “banana”: 2}

print(x.get(“banana”))

  • A) 1
  • B) 2
  • C) banana
  • D) None

Answers Table

QnoAnswer
1B) Hello, World!
2A) P
3A) 1.666
4B) 16
5B) [10, 2, 3]
6C) tho
7B) [1, 2, 3, 4]
8A) 15
9A) <class ‘int’>
10A) 3
11B) [2, 3]
12A) 6
13A) x is greater
14A) Hello Alice
15A) elppa
16A) 600
17A) 15
18A) [1, 3]
19B) {1, 2, 3, 4}
20B) [1, 2, 4]
21B) False
22B) [10, 2, 3]
23A) Division by zero
24B) 25
25A) 124
26B) {1, 3, 4}
27A) 5
28B) [1, 3]
29B) 4
30B) b
31A) <class ‘tuple’>
32B) 2
33A) PYTHON
34A) 8
35B) 2

Python Functions and Control Flow

36. What is the output of the following code?

def add(a, b):

    return a + b

print(add(3, 4))

  • A) 34
  • B) 7
  • C) Error
  • D) None

37. What will be printed by this code?

def subtract(a, b=5):

    return a – b

print(subtract(10))

  • A) 10
  • B) 5
  • C) 15
  • D) Error

38. What is the output of the following code?

def square(x):

    return x ** 2

print(square(5))

  • A) 5
  • B) 25
  • C) 10
  • D) 0

39. What will be printed by the following code?

x = 10

if x > 5:

    print(“Greater”)

else:

    print(“Smaller”)

  • A) Greater
  • B) Smaller
  • C) Error
  • D) None

40. What will be the output of this code?

x = 3

if x > 3:

    print(“Greater”)

elif x == 3:

    print(“Equal”)

else:

    print(“Smaller”)

  • A) Greater
  • B) Equal
  • C) Smaller
  • D) None

41. What will be the result of the following code?

x = 10

y = 3

print(x % y)

  • A) 3
  • B) 1
  • C) 10
  • D) 7

42. What is the output of this code?

x = [10, 20, 30]

x.insert(1, 15)

print(x)

  • A) [10, 15, 20, 30]
  • B) [10, 15, 30]
  • C) [15, 10, 20, 30]
  • D) [10, 20, 15, 30]

43. What is the result of this code?

x = 1

y = 2

z = 3

print(x + y * z)

  • A) 9
  • B) 7
  • C) 5
  • D) 6

44. What will be printed by this code?

x = 5

y = 6

x, y = y, x

print(x, y)

  • A) 6 5
  • B) 5 6
  • C) Error
  • D) None

45. What is the output of the following code?

for i in range(3):

    print(i, end=” “)

  • A) 0 1 2
  • B) 1 2 3
  • C) 0 1 2 3
  • D) None

Lists, Tuples, and Dictionaries

46. What is the output of the following code?

x = [1, 2, 3]

y = x

y[0] = 10

print(x)

  • A) [1, 2, 3]
  • B) [10, 2, 3]
  • C) [1, 10, 3]
  • D) Error

47. What will be printed by the following code?

x = [1, 2, 3]

x.pop(1)

print(x)

  • A) [1, 3]
  • B) [1, 2]
  • C) [2, 3]
  • D) [1, 2, 3]

48. What will the following code output?

x = (10, 20, 30)

print(x[1])

  • A) 10
  • B) 20
  • C) 30
  • D) Error

49. What is the output of the following code?

x = {“name”: “Alice”, “age”: 25}

print(x.get(“name”))

  • A) Alice
  • B) name
  • C) 25
  • D) Error

50. What will be the output of the following code?

x = [1, 2, 3, 4]

x.extend([5, 6])

print(x)

  • A) [1, 2, 3, 4, 5, 6]
  • B) [1, 2, 3, 4, [5, 6]]
  • C) [5, 6, 1, 2, 3, 4]
  • D) None

51. What will the following code output?

x = {“apple”: 1, “banana”: 2}

del x[“apple”]

print(x)

  • A) {“apple”: 1, “banana”: 2}
  • B) {“banana”: 2}
  • C) {“apple”: 2}
  • D) Error

52. What will the result of this code be?

x = [1, 2, 3, 4]

x.reverse()

print(x)

  • A) [1, 2, 3, 4]
  • B) [4, 3, 2, 1]
  • C) None
  • D) [4, 2, 3, 1]

53. What will be printed by this code?

x = (10, 20, 30)

x = x + (40,)

print(x)

  • A) (10, 20, 30, 40)
  • B) (40, 10, 20, 30)
  • C) (10, 20, 30)
  • D) Error

54. What is the output of this code?

x = {1, 2, 3}

x.add(4)

print(x)

  • A) {1, 2, 3}
  • B) {1, 2, 3, 4}
  • C) {4, 1, 2, 3}
  • D) None

String Manipulation

55. What will be printed by the following code?

x = “hello”

print(x[1:4])

  • A) h
  • B) ell
  • C) lo
  • D) hello

56. What is the result of this code?

x = “Python”

print(x[2:5])

  • A) Pyt
  • B) tho
  • C) Py
  • D) ton

57. What is the output of this code?

x = “hello”

print(x.upper())

  • A) HELLO
  • B) hello
  • C) Error
  • D) None

58. What will be printed by the following code?

x = “hello”

print(x[::2])

  • A) h
  • B) he
  • C) hlo
  • D) None

59. What will the following code output?

x = “hello”

y = x.replace(“e”, “a”)

print(y)

  • A) hallo
  • B) hella
  • C) hello
  • D) None

60. What will the result of this code be?

x = “hello”

print(len(x))

  • A) 4
  • B) 5
  • C) 6
  • D) None

Answers Table

QnoAnswer
36B) 7
37B) 5
38B) 25
39A) Greater
40B) Equal
41B) 1
42A) [10, 15, 20, 30]
43A) 9
44A) 6 5
45A) 0 1 2
46B) [10, 2, 3]
47A) [1, 3]
48B) 20
49A) Alice
50A) [1, 2, 3, 4, 5, 6]
51B) {“banana”: 2}
52B) [4, 3, 2, 1]
53A) (10, 20, 30, 40)
54B) {1, 2, 3, 4}
55B) ell
56B) tho
QnoAnswer
57A) HELLO
58C) hlo
59A) hallo
60B) 5


Python Functions and Control Flow

61. What is the output of the following code?

def greet(name=”World”):

    return “Hello ” + name

print(greet(“Alice”))

  • A) Hello Alice
  • B) Hello World
  • C) Hello
  • D) Error

62. What will be printed by the following code?

x = 5

def test():

    x = 10

    print(x)

test()

  • A) 10
  • B) 5
  • C) Error
  • D) None

63. What is the result of this code?

def square(x):

    return x * x

result = square(3)

print(result)

  • A) 3
  • B) 9
  • C) 6
  • D) None

64. What will be printed by the following code?

x = 2

y = 3

print(x ** y)

  • A) 5
  • B) 8
  • C) 6
  • D) None

65. What will be the result of this code?

x = 10

y = 2

print(x // y)

  • A) 5
  • B) 2
  • C) 10
  • D) None

66. What will be the output of this code?

x = [1, 2, 3]

y = [4, 5, 6]

print(x + y)

  • A) [1, 2, 3, 4, 5, 6]
  • B) [4, 5, 6, 1, 2, 3]
  • C) Error
  • D) None

67. What will the following code print?

x = 5

y = 6

z = 10

print(x < y and y < z)

  • A) True
  • B) False
  • C) None
  • D) Error

68. What is the output of this code?

x = 7

y = 2

print(x ** y)

  • A) 49
  • B) 128
  • C) 14
  • D) None

69. What will be the result of this code?

x = 4

y = 5

if x > y:

    print(“x is greater”)

else:

    print(“y is greater”)

  • A) x is greater
  • B) y is greater
  • C) Error
  • D) None

70. What will this code output?

x = “Python”

print(x[1:4])

  • A) Pyt
  • B) yth
  • C) ytho
  • D) None

Data Structures

71. What is the output of the following code?

x = [1, 2, 3, 4]

x.remove(3)

print(x)

  • A) [1, 2, 3, 4]
  • B) [1, 2, 4]
  • C) [2, 3, 4]
  • D) Error

72. What is the result of the following code?

x = [1, 2, 3]

print(x * 2)

  • A) [1, 2, 3, 1, 2, 3]
  • B) [2, 3, 1]
  • C) [1, 2, 3]
  • D) None

73. What will be the output of this code?

x = (1, 2, 3)

y = list(x)

y[0] = 10

print(x)

  • A) (1, 2, 3)
  • B) [10, 2, 3]
  • C) (10, 2, 3)
  • D) Error

74. What will this code output?

x = {1, 2, 3}

x.add(4)

print(x)

  • A) {1, 2, 3, 4}
  • B) {1, 2, 3}
  • C) [1, 2, 3, 4]
  • D) None

75. What is the output of this code?

x = {“apple”: 1, “banana”: 2}

print(x.keys())

  • A) dict_keys([‘apple’, ‘banana’])
  • B) [‘apple’, ‘banana’]
  • C) (1, 2)
  • D) Error

76. What will the following code print?

x = {“a”: 1, “b”: 2}

x[“c”] = 3

print(x)

  • A) {“a”: 1, “b”: 2, “c”: 3}
  • B) {“a”: 1, “b”: 2}
  • C) {“c”: 3}
  • D) Error

77. What is the output of this code?

x = [1, 2, 3]

y = [4, 5]

x.extend(y)

print(x)

  • A) [1, 2, 3, 4, 5]
  • B) [4, 5, 1, 2, 3]
  • C) [1, 2, 3]
  • D) Error

78. What will be the result of the following code?

x = {1, 2, 3}

x.discard(2)

print(x)

  • A) {1, 3}
  • B) {1, 2, 3}
  • C) {2, 3}
  • D) Error

79. What will this code output?

x = {“name”: “Alice”, “age”: 25}

print(x.get(“age”))

  • A) 25
  • B) age
  • C) Alice
  • D) Error

String Manipulation

80. What is the output of the following code?

x = “hello”

print(x[::-1])

  • A) olleh
  • B) hello
  • C) he
  • D) Error

81. What is the result of this code?

x = “Python”

print(x[1:4])

  • A) Pyt
  • B) yth
  • C) tho
  • D) None

82. What will be the output of this code?

x = “hello”

print(x.replace(“e”, “a”))

  • A) hallo
  • B) hella
  • C) hello
  • D) Error

83. What is the result of this code?

x = “hello”

y = x.upper()

print(y)

  • A) HELLO
  • B) hello
  • C) hEllo
  • D) Error

84. What will be printed by this code?

x = “Python”

print(x[::2])

  • A) Pto
  • B) Py
  • C) hton
  • D) None

85. What is the output of this code?

x = “Python”

y = x.split(“t”)

print(y)

  • A) [‘Py’, ‘hon’]
  • B) [‘Python’]
  • C) [‘P’, ‘hon’]
  • D) Error

86. What will this code output?

x = “apple”

print(x.find(“p”))

  • A) 1
  • B) 2
  • C) 3
  • D) Error

87. What will be the result of this code?

x = “Python”

print(x.startswith(“Py”))

  • A) True
  • B) False
  • C) Error
  • D) None

88. What is the output of this code?

x = “Python”

print(x.lower())

  • A) python
  • B) PYTHON
  • C) Python
  • D) None

89. What will the following code print?

x = “Python”

print(x[1:])

  • A) ython
  • B) Py
  • C) P
  • D) None

90. What is the result of this code?

x = ”  hello  “

print(x.strip())

  • A) hello
  • B) hello
  • C) hello
  • D) None

Answers Table

QnoAnswer
61A) Hello Alice
62A) 10
63B) 9
64B) 8
65A) 5
66A) [1, 2, 3,4, 5, 6]
QnoAnswer
67A) True
68B) 128
69B) y is greater
70B) yth
71B) [1, 2, 4]
72A) [1, 2, 3, 1, 2, 3]
73A) (1, 2, 3)
74A) {1, 2, 3, 4}
75A) dict_keys([‘apple’, ‘banana’])
76A) {“a”: 1, “b”: 2, “c”: 3}
77A) [1, 2, 3, 4, 5]
78A) {1, 3}
79A) 25
80A) olleh
81B) yth
82A) hallo
83A) HELLO
84A) Pto
85A) [‘Py’, ‘hon’]
86A) 1
87A) True
88A) python
89A) ython
90A) hello


These questions help assess understanding of Python functions, control flow, data structures, and string manipulation.

 Advanced Python Functions and Concepts

91. What will be the output of the following code?

def func(x, y=2):

    return x * y

print(func(5))

  • A) 5
  • B) 10
  • C) Error
  • D) None

92. What is the result of this code?

def add(a, b=10, c=5):

    return a + b + c

print(add(3))

  • A) 8
  • B) 18
  • C) 15
  • D) Error

93. What will the following code print?

def outer():

    x = 10

    def inner():

        print(x)

    inner()

outer()

  • A) 10
  • B) Error
  • C) None
  • D) inner

94. What will this code output?

def greet(name):

    print(f”Hello, {name}”)

greet(“Python”)

  • A) Hello, Python
  • B) Hello, name
  • C) Error
  • D) None

95. What will be printed by this code?

def func(a, b):

    a = 5

    return a + b

print(func(3, 4))

  • A) 7
  • B) 9
  • C) 5
  • D) None

96. What is the output of this code?

def factorial(n):

    if n == 0:

        return 1

    else:

        return n * factorial(n – 1)

print(factorial(4))

  • A) 24
  • B) 12
  • C) 4
  • D) Error

97. What will be the output of this code?

def func(a, b):

    return a ** b

print(func(2, 3))

  • A) 6
  • B) 8
  • C) 9
  • D) None

98. What will be printed by this code?

def my_func():

    return 3 * 5

print(my_func())

  • A) 15
  • B) 3
  • C) 5
  • D) None

99. What is the output of this code?

def counter():

    count = 0

    def increment():

        nonlocal count

        count += 1

    increment()

    return count

print(counter())

  • A) 1
  • B) 0
  • C) Error
  • D) None

100. What is the output of the following code?

def add(x, y):

    return x + y

result = add(“hello”, ” world”)

print(result)

  • A) hello world
  • B) hello
  • C) Error
  • D) None

Object-Oriented Programming

101. What will be the result of the following code?

class Animal:

    def speak(self):

        print(“Animal speaks”)

class Dog(Animal):

    def speak(self):

        print(“Dog barks”)

d = Dog()

d.speak()

  • A) Animal speaks
  • B) Dog barks
  • C) Error
  • D) None

102. What will be printed by this code?

class Car:

    def __init__(self, make, model):

        self.make = make

        self.model = model

    def __str__(self):

        return f”{self.make} {self.model}”

car = Car(“Toyota”, “Corolla”)

print(car)

  • A) Toyota Corolla
  • B) Car object
  • C) Error
  • D) None

103. What is the output of this code?

class Person:

    def __init__(self, name):

        self.name = name

    def greet(self):

        print(f”Hello, {self.name}”)

p = Person(“Alice”)

p.greet()

  • A) Hello, Alice
  • B) Error
  • C) Hello, name
  • D) None

104. What will be printed by this code?

class Parent:

    def __init__(self):

        self.value = 10

class Child(Parent):

    def __init__(self):

        super().__init__()

        self.value += 5

    def display(self):

        print(self.value)

c = Child()

c.display()

  • A) 10
  • B) 15
  • C) 5
  • D) None

105. What will be the output of this code?

class A:

    def __init__(self):

        self.x = 10

class B(A):

    def __init__(self):

        super().__init__()

        self.x += 5

b = B()

print(b.x)

  • A) 15
  • B) 10
  • C) 5
  • D) None

106. What will be printed by this code?

class Base:

    def method(self):

        print(“Base method”)

class Derived(Base):

    def method(self):

        print(“Derived method”)

d = Derived()

d.method()

  • A) Derived method
  • B) Base method
  • C) Error
  • D) None

107. What will be printed by this code?

class Vehicle:

    def __init__(self, brand, model):

        self.brand = brand

        self.model = model

    def display(self):

        print(f”Brand: {self.brand}, Model: {self.model}”)

car = Vehicle(“Honda”, “Civic”)

car.display()

  • A) Brand: Honda, Model: Civic
  • B) Vehicle object
  • C) Error
  • D) None

108. What will be the output of this code?

class Animal:

    def __init__(self):

        self.type = “Mammal”

class Dog(Animal):

    def __init__(self):

        super().__init__()

        self.breed = “Bulldog”

d = Dog()

print(d.type, d.breed)

  • A) Mammal Bulldog
  • B) Bulldog Mammal
  • C) Error
  • D) None

109. What is the output of this code?

class Car:

    def __init__(self, color):

        self.color = color

    def show(self):

        print(self.color)

car = Car(“Red”)

car.show()

  • A) Red
  • B) Error
  • C) None
  • D) Car object

Advanced Python Concepts

110. What will be printed by this code?

x = [1, 2, 3]

y = [4, 5, 6]

z = x

z += y

print(z)

  • A) [1, 2, 3, 4, 5, 6]
  • B) [1, 2, 3]
  • C) Error
  • D) None

111. What will the output be for the following code?

x = “abc”

y = “def”

print(f”{x}{y}”)

  • A) abcdef
  • B) a b c d e f
  • C) Error
  • D) None

112. What is the output of this code?

def decorator(func):

    def wrapper():

        print(“Before function”)

        func()

        print(“After function”)

    return wrapper

@decorator

def say_hello():

    print(“Hello”)

say_hello()

  • A) Before function, Hello, After function
  • B) Error
  • C) Hello
  • D) None

113. What will be the result of this code?

a = [1, 2, 3]

b = a

b[0] = 10

print(a)

  • A) [10, 2, 3]
  • B) [1, 2, 3]
  • C) Error
  • D) None

114. What is the output of this code?

def func(x, y):

    return x if x > y else y

print(func(5, 10))

  • A) 10
  • B) 5
  • C) Error
  • D) None

115. What will be printed by this code?

x = {1, 2, 3}

x.add(4)

x.add(5)

x.remove(3)

print(x)

  • A) {1, 2, 4, 5}
  • B) {4, 5, 3}
  • C) {1, 2, 3, 4, 5}
  • D) None

116. What is the output of this code?

x = “hello”

y = x.split(“e”)

print(y)

  • A) [‘h’, ‘llo’]
  • B) [‘hello’]
  • C) [‘e’, ‘llo’]
  •  

D) Error

117. What will be the output of this code?

x = 10

def outer():

    x = 20

    def inner():

        global x

        x = 30

    inner()

    print(x)

outer()

  • A) 30
  • B) 10
  • C) 20
  • D) Error

118. What will be the result of the following code?

x = [1, 2, 3, 4]

x.pop()

print(x)

  • A) [1, 2, 3]
  • B) [1, 2, 3, 4]
  • C) Error
  • D) None

119. What is the result of this code?

x = “Hello”

print(x[-1])

  • A) o
  • B) H
  • C) Error
  • D) None

120. What is the output of this code?

x = “Python”

print(x[2:5])

  • A) tho
  • B) Pyt
  • C) py
  • D) None

Answers Table

QnoAnswer
91B) 10
92B) 18
93A) 10
94A) Hello, Python
95B) 9
96A) 24
97B) 8
98A) 15
99A) 1
100A) hello world
101B) Dog barks
102A) Toyota Corolla
103A) Hello, Alice
104B) 15
105A) 15
106A) Derived method
107A) Brand: Honda, Model: Civic
108A) Mammal Bulldog
109A) Red
110A) [1, 2, 3, 4, 5, 6]
111A) abcdef
112A) Before function, Hello, After function
113A) [10, 2, 3]
114A) 10
115A) {1, 2, 4, 5}
116A) [‘h’, ‘llo’]
117A) 30
118A) [1, 2, 3]
119A) o
120A) tho

Use a Blank Sheet, Note your Answers and Finally tally with our answer at last. Give Yourself Score.

X
error: Content is protected !!
Scroll to Top