python 1

python 1

1st Grade

20 Qs

quiz-placeholder

Similar activities

java 4

java 4

1st Grade

20 Qs

3rd Mid-Quarterly Assessment in MAPEH

3rd Mid-Quarterly Assessment in MAPEH

1st Grade

25 Qs

art time

art time

1st - 4th Grade

17 Qs

1° parcial de ortografía y gramática

1° parcial de ortografía y gramática

1st Grade - University

24 Qs

Refresquem la memòria després de nadal

Refresquem la memòria després de nadal

1st - 4th Grade

19 Qs

Week 11 - Web Security 1

Week 11 - Web Security 1

1st - 5th Grade

19 Qs

SENI GRAFIS

SENI GRAFIS

KG - 1st Grade

20 Qs

java 3

java 3

1st Grade

20 Qs

python 1

python 1

Assessment

Quiz

Arts

1st Grade

Hard

Created by

Nagendrapatel Puppala

Used 1+ times

FREE Resource

20 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

What is the output of the following program?

D = {1 : 1, 2 : '2', '1' : 2, '2' : 3}

D['1'] = 2

print(D[D[D[str(D[1])]]])

2

3

'2'

error

2.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

What is the output of the following program?

D = {1 : {'A' : {1 : "A"}, 2 : "B"}, 3 :"C", 'B' : "D", "D": 'E'}

print(D[D[D[1][2]]], end = " ")

print(D[D[1]["A"][2]])

D C

D E

D B

ERROR

3.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

What is the output of the following program?

D = dict()

for i in range (3):

    for j in range(2):

        D[i] = j

print(D)

{0: 0, 1: 0, 2: 0} 

{0: 1, 1: 1, 2: 1} 

{0: 0, 1: 0, 2: 0, 0: 1, 1: 1, 2: 1} 

TypeError: Immutable object 

4.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

count = 1 

  

def doThis():

  

    global count

  

    for i in (1, 2, 3): 

        count += 1

  

doThis()

  

print (count)

OUTPUT=??

3

5

4

NONE

5.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

check1 = ['Learn', 'Quiz', 'Practice', 'Contribute']

check2 = check1

check3 = check1[:]

 

check2[0] = 'Code'

check3[1] = 'Mcq'

 

count = 0

for c in (check1, check2, check3):

    if c[0] == 'Code':

        count += 1

    if c[1] == 'Mcq':

        count += 10

 

print (count)

OUTPUT=???

34

5

24

12

6.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

a = "MLRITM"

  

b = 13

  

print (a + b)

OUTPUT=??

ERROR

12

24

98

7.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

what is the output of the program??

import numpy as np

  

a = np.array([1.0, 2.0, 3.0])

  

# Example 1

b = 2.0

print(a * b)

  

# Example 2

c = [2.0, 2.0, 2.0]

print(a * c)

[ 5. 4. 6.] [ 8. 4. 6.]

[ 2. 4. 8.] [ 2. 4. 7.]

[ 2. 4. 6.] [ 2. 4. 6.]

none

Create a free account and access millions of resources

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?