Which of the following is a correct way to print “Hello, World!” in Python?
Answer: B) print("Hello, World!")
Merge Sort uses which of the following techniques?
Answer: A) Divide and conquer
What is the output of the following code?
Answer: 3
What will the following code output?
Answer: Yes
What will the following code output?
Answer: banana
In Bubble Sort, after each pass, where will the largest unsorted element be located?
What is the output of the code print(10 % 3)?
Answer: B) 1
What will be the output of the following code?
Answer: Hello Alice!
Which of the following keywords is used to define a function in Python?
Answer: C) def
What will the following code output?
for i in range(3):
print(i)
Answer: A) 0 1 2
What will the following code output?
Answer: 15
(The += operator adds 5 to x.)
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.)
What does the range(3) function produce in Python?
Answer: A sequence of numbers from 0 to 2
What will the following code output?
Answer: A) 3
What is the correct way to define a list in Python?
Answer: B) my_list = [1, 2, 3] (Lists are defined with square brackets [].)
What will the following code print?
Answer: 9
(since x ** y means 32=93^2 = 932=9)
Which keyword is used to start a conditional statement in Python?
Answer: if
What will the following code print?
Answer: Python (printed 4 times, each on a new line)
What will this code output?
Answer: A) True
Which of the following is an operating system?
Answer: C) Linux
What will the following code output?
Answer: B) (1,1) (1,2) (2,1) (2,2) (3,1) (3,2)
What is the output of the following code?
Answer : True
What does Wi-Fi stand for?
Answer: A) Wireless Fidelity
What does GPS stand for?
Answer: Global Positioning System
What is the output of the following code?
Answer: 56