Random Values
AP Computer Science Principles · Flashcards · Application
AP COMPUTER SCIENCE PRINCIPLES · FLASHCARDS
Card 1
of 4
0 got it
0 to review
Current
Got it
Still learning
Not seen
QUESTION
Find the error: random(0,1) generates a number between 0 and 1.
QUESTION
Find the error: Using the same seed always produces different random sequences.
QUESTION
Find the error: random.uniform(1, 10) gives integers between 1 and 10.
Tap to flip before you grade
ANSWER
Correct: Yields floats, not integers. Uniform distribution produces continuous values, not discrete integers.
Swipe → got it · swipe ← still learning
Got it
Still learning
Flip Card
Previous card
Next card