Search Header Logo
Python using random

Python using random

Assessment

Presentation

Computers

10th Grade

Easy

DOK Level 1: Recall

Standards-aligned

Created by

Roy Duguid

Used 3+ times

FREE Resource

22 Slides • 5 Questions

1

Python Random number generation

2

media

3

media

4

media

5

media

6

media

7

media

8

media

9

media

10

media

11

media

Return 0,2,4,6,8 (but not 10)

12

media

13

Multiple Choice

Question image

What will this code output?

1

error

2

A number from 0 to 6

3

A number from 1 to 5

4

A number from 1 to 6

14

Multiple Choice

Which of the following is used to generate a random number between 1 and 10 in Python?

1

random.range(1, 10)

2

random.randint(1, 10)

3

random.random(1, 10)

4

random.number(1, 10)

15

Multiple Choice

What is the minimum and maximum value of 'A' in the following statement..

import random

A=random.randint(2,30)

print(A)

1

3 and 30

2

2and 30

3

2 and 29

16

Multiple Choice

Question image

What is the minimum and maximum value of 'num' in the following statement..

import random

1

min: 1, max: 19

2

min: 1, max: 20

3

min: 0, max: 20

4

min: 0, max: 19

17

Multiple Choice

Question image

What is the minimum and maximum value of 'num' in the following statement..

import random

1

min: 1, max: 19

2

min: 1, max: 20

3

min: 0, max: 20

4

min: 0, max: 19

18

media

19

media

20

media

21

media

22

media

23

media

24

media

25

media

26

media

27

Paper 1 programming > Random

Python Random number generation

Show answer

Auto Play

Slide 1 / 27

SLIDE