Completed
KVCoders Live Challenge — Internal Preview
Questions From This Challenge
Q1mcq1 mark
Which Python data structure stores data as key-value pairs?
List
Tuple
Dictionary ✓
Set
Q2output1 mark
What will be the output of the following Python code?
x = [10, 20, 30, 40] print(x[-2])
Correct output:
30Q3mcq1 mark
Which SQL clause is used to filter rows after grouping?
WHERE
GROUP BY
HAVING ✓
ORDER BY
Q4output1 mark
What will be the output of the following Python code?
s = "COMPUTER" print(s[1:5])
Correct output:
OMPUQ5mcq1 mark
Which Python method is used to add a single element to the end of a list?
append() ✓
add()
insert()
extend()
Q6output1 mark
What will be the output of the following Python code?
total = 0
for i in range(1, 6):
if i % 2 == 0:
total += i
print(total)
Correct output:
6Q7mcq1 mark
Which SQL command is used to permanently remove a table from a database?
DELETE TABLE
DROP TABLE ✓
REMOVE TABLE
CLEAR TABLE
Q8output1 mark
What will be the output of the following Python code?
data = {"A": 10, "B": 20, "C": 30}
data["B"] += 5
print(data["B"])
Correct output:
25Q9mcq1 mark
Which file mode opens a file for writing and creates the file if it does not exist?
r
a
w ✓
x
Q10output1 mark
What will be the output of the following Python code?
def calculate(a, b=5):
return a * b
print(calculate(4))
print(calculate(4, 3))
Correct output:
20
12Q11mcq1 mark
Which SQL function returns the number of rows in a table?
SUM()
COUNT() ✓
TOTAL()
NUMBER()
Q12output1 mark
What will be the output of the following Python code?
numbers = [2, 4, 6, 8] numbers.insert(2, 10) print(numbers)
Correct output:
[2, 4, 10, 6, 8]Q13mcq1 mark
Which Python module is commonly used to work with CSV files?
csv ✓
file
table
records
Q14output1 mark
What will be the output of the following Python code?
try:
x = 10
y = 0
print(x // y)
except ZeroDivisionError:
print("Error")
finally:
print("Done")
Correct output:
Error
DoneQ15output1 mark
What will be the output of the following Python code?
numbers = [5, 2, 8, 1, 6] numbers.sort() print(numbers[-1]) print(numbers[0])
Correct output:
8
1