Python Test 2

Python Test 2

University

19 Qs

quiz-placeholder

Similar activities

PHP hypertext preprocessor

PHP hypertext preprocessor

University

20 Qs

Envistas - Technical Quiz - Round 1

Envistas - Technical Quiz - Round 1

University

15 Qs

Understanding Arrays in Python and Numpy

Understanding Arrays in Python and Numpy

University

15 Qs

ATP_AIML_D1_Reflections

ATP_AIML_D1_Reflections

University - Professional Development

15 Qs

GirlsWhoML Workshop 0

GirlsWhoML Workshop 0

University

20 Qs

numpy

numpy

University

21 Qs

DAA QUIZ-2

DAA QUIZ-2

University

19 Qs

Data Structures Quiz 1

Data Structures Quiz 1

12th Grade - University

18 Qs

Python Test 2

Python Test 2

Assessment

Quiz

Computers

University

Medium

Created by

Peter Parfenov

Used 1+ times

FREE Resource

AI

Enhance your content

Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...

19 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

import numpy as np

a = np.array([[1, 2], [3, 4], [5, 6]])

b = a.flatten()

print(len(a), len(b))

6 2

2 3

3 6

3 2

2.

MULTIPLE SELECT QUESTION

45 sec • 1 pt

What do you expect from this code (more than 1 answer)?

import numpy as np

a = np.arange(4)

b = a / 0

print(b)

[nan nan nan]

[nan inf inf inf]

Zero Division Warning

[inf inf inf inf]

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

import numpy as np

a = np.linspace(1, 3, 3) ** 3

x = a > 20

print(x)

[False False True]

[True True False]

[True True True]

[False False False]

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

import numpy as np

x1 = np.linspace(0, 5, 5, endpoint=False)

y1 = np.linspace(0, 5, 5, endpoint=True)

x2 = np.linspace(0, 5, 5, endpoint=False)

y2 = np.linspace(0, 4, 5, endpoint=True)

print(np.sum(x1) == np.sum(y1), np.sum(x2) == np.sum(y2))

[True True]

[False False]

[True False]

[False True]

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

import numpy as np

a = np.arange(2)

b = np.arange(2, 0, -1)

print(a == b)

[False True]

[True True]

[False False]

[True False]

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

import numpy as np

a = np.array(((1, 0, 1), (0, 1, 0)))

print(a.size)

3

2

6

(2, 6)

(2, 3)

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

import numpy as np

a = np.array(((1, 0, 1), (0, 1, 0)))

print(a.ndim)

2

3

6

(2, 3)

(2, 6)

Create a free account and access millions of resources

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

By signing up, you agree to our Terms of Service & Privacy Policy

Already have an account?