1
2
3
4
5
100

Which of the following is a correct way to print “Hello, World!” in Python?

  • A) print(Hello, World!)
  • B) print("Hello, World!")
  • C) echo "Hello, World!"

Answer: B) print("Hello, World!")

100

Merge Sort uses which of the following techniques?

  • A) Divide and conquer
  • B) Swapping elements
  • C) Insertion

Answer: A) Divide and conquer

100

What is the output of the following code?

my_list = [1, 2, 3]
print(len(my_list))


Answer: 3

100

What will the following code output?

if 5 > 3:    print("Yes")
else:    print("No")


Answer: Yes

100

What will the following code output?

fruits = ["apple", "banana", "cherry"]
print(fruits[1])


Answer: banana

200

In Bubble Sort, after each pass, where will the largest unsorted element be located?

  • A) At the beginning of the list
  • B) At the end of the list
  • B) At the end of the list
200

What is the output of the code print(10 % 3)?

  • A) 0
  • B) 1
  • C) 3

Answer: B) 1

200

What will be the output of the following code?

name = "Alice"
print("Hello " + name + "!")


Answer: Hello Alice!

200

Which of the following keywords is used to define a function in Python?

  • A) define
  • B) func
  • C) def

Answer: C) def

200

What will the following code output?

for i in range(3):    

    print(i)

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

  Answer: A) 0 1 2 

300

What will the following code output?

x = 10
x += 5
print(x)


Answer: 15 

(The += operator adds 5 to x.)

300

In Bubble Sort, how many passes will it take to fully sort the list [5, 3, 2, 4, 1]?

Answer: 4 passes (Bubble Sort takes n-1 passes in the worst case, where n is the length of the list.)

300

What does the range(3) function produce in Python?

Answer: A sequence of numbers from 0 to 2

300

What will the following code output?

x = 10
y = 3
print(x // y)


  • A) 3
  • B) 3.33
  • C) 4

Answer: A) 3

300

What is the correct way to define a list in Python?

  • A) my_list = {1, 2, 3}
  • B) my_list = [1, 2, 3]
  • C) my_list = (1, 2, 3)

Answer: B) my_list = [1, 2, 3] (Lists are defined with square brackets [].)

400

What will the following code print?

x = 3
y = 2
print(x ** y)


Answer: 9 

(since x ** y means 32=93^2 = 932=9)

400

Which keyword is used to start a conditional statement in Python?

Answer: if

400

What will the following code print?

for x in range(4):
    print("Python")


Answer: Python (printed 4 times, each on a new line)

400

What will this code output?

x = 4
y = 3
print(x > y and y > 2)


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

Answer: A) True

400

Which of the following is an operating system?

  • A) Microsoft Word
  • B) Google Chrome
  • C) Linux

Answer: C) Linux

500

What will the following code output?

for i in range(1, 4):
    for j in range(1, 3):
        print(i, j)


  • A) (1,1) (2,1) (3,1)
  • B) (1,1) (1,2) (2,1) (2,2) (3,1) (3,2)
  • C) (1,1) (1,1) (2,2) (3,3)

Answer: B) (1,1) (1,2) (2,1) (2,2) (3,1) (3,2)

500

What is the output of the following code?

def check(x):
    if x % 2 == 0:
        return "even"
    else:
        return "odd"
print(check(10) == "even")


Answer : True

500

What does Wi-Fi stand for?

  • A) Wireless Fidelity
  • B) Wide Frequency
  • C) Web Frequency

Answer: A) Wireless Fidelity

500

What does GPS stand for?

Answer: Global Positioning System

500

What is the output of the following code?

print("5" + "6")


Answer: 56