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)
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)