Search Header Logo

python 1

Authored by Nagendrapatel Puppala

Arts

1st Grade

Used 1+ times

python 1
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

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

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?