Welcome to ExamTopics
ExamTopics Logo
- Expert Verified, Online, Free.
exam questions

Exam PCAP-31-03 All Questions

View all questions & answers for the PCAP-31-03 exam

Exam PCAP-31-03 topic 1 question 4 discussion

Actual exam question from Python Institute's PCAP-31-03
Question #: 4
Topic #: 1
[All PCAP-31-03 Questions]

Assuming that the code below has been executed successfully, which of the following expressions will always evaluate to True? (Choose two.) import random v1 = random.random() v2 = random.random()

  • A. len(random.sample([1,2,3],1)) > 2
  • B. v1 == v2
  • C. random.choice([1,2,3]) > 0
  • D. v1>1
Show Suggested Answer Hide Answer
Suggested Answer: BC 🗳️

Comments

Chosen Answer:
This is a voting comment (?) , you can switch to a simple comment.
Switch to a voting comment New
Sharif24
2 months, 4 weeks ago
Selected Answer: C
import random v1 = random.random() v2 = random.random() print(v1 ==v2) #False print(v1>1) # False print(random.choice(([1,2,3],1))>0) # True
upvoted 1 times
...
DKAT2023
4 months, 3 weeks ago
C is the correct
upvoted 1 times
...
Nikhil_Durgesh
6 months ago
Option C is correct Explanation: import random v1 = random.random() v2 = random.random() random.choice([1,2,3]) > 0` will return TRUE. All others options will return output as FALSE.
upvoted 2 times
...
narayanan010
6 months, 1 week ago
Only option C, `random.choice([1,2,3]) > 0` will return TRUE. All other options are FALSE.
upvoted 4 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...