Search Header Logo

Вопросы по модулю random

Authored by Ерасыл Тлеудин

Computers

12th Grade

Used 5+ times

Вопросы по модулю random
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

25 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which function from the random module returns a random number between 0 and 1 (excluding 1)?

randint

random

randrange

choice

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which function selects a random element from a list?

randint

sample

choice

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does the shuffle function do?

Shuffles the list in place

Selects a random element from the list

Returns a random number between 0 and 1

Returns a list of random elements

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which function returns a random integer in the range [a, b] (including both ends)?

randint

random

sample

choices

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does the function randrange return?

A random integer between a and b (inclusive of b)

A random integer between a and b (exclusive of b)

A random element from a list

A list of random numbers

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which function allows you to select several unique random elements from a list?

sample

choice

choices

shuffle

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

In which function can you specify weights for selecting elements from a list?

choices

choice

sample

randrange

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?