QuestionQ52

VerifiedModules and Packages

Assuming the following code has run successfully, which expression will always evaluate to True?

import random  
v1 = random.random()  
v2 = random.random()  
Explanation

random.choice([1,2,3]) returns an element from that nonempty sequence. Its possible results are 1, 2, and 3, each of which is greater than zero. The other expressions are either always false or not guaranteed to be true.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!