
Quiz 1
Authored by Prabha arya
Government
University
Used 1+ times

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
35 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the output of the following code snippet? stack = [] stack.append(10) stack.append(20) print(stack.pop())
10
20
None
Error
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the output of the following code snippet? q = [] q.append(1) q.append(2) q.pop(0) print(q)
[1]
[2]
[]
Error
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the output of the following code snippet? int arr[] = {1,2,3}; printf("%d", *(arr+1));
1
2
3
Error
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the output of the following Java code snippet? Queue
10
20
null
Error
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the output of the following Python function when f(2) is called? def f(n): if n==0: return 0 return n + f(n-1) print(f(2))
2
3
4
1
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the output of the following Python code snippet? graph = {1:[2,3]} print(len(graph[1]))
1
2
3
Error
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the output of the following Python code snippet? import heapq h=[] heapq.heappush(h,10) heapq.heappush(h,20) print(len(h))
A. 1
B. 2
C. 0
D. Error
Access all questions and much more by creating a free account
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
Already have an account?