2.2.3(g) Random numbers Flashcards

1
Q

create a random integer between 1 and 6 inclusive

A

pseudocode
myVariable = random (1,6)

python
myVariable - random.randint (1,6)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

create a random real number between -1.0 and 10.0 inclusive

A

pseudocode
myVariable = random(-1.0, 10.0)

python
myVariable - random.randint (-1,10)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly