Search Header Logo

Quiz 1

Authored by Prabha arya

Government

University

Used 1+ times

Quiz 1
AI

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 q = new LinkedList<>(); q.add(10); q.add(20); q.remove(); System.out.println(q.peek());

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

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?