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

Unlimited Access

Get Unlimited Contributor Access to the all ExamTopics Exams!
Take advantage of PDF Files for 1000+ Exams along with community discussions and pass IT Certification Exams Easily.

Exam PCAP topic 1 question 46 discussion

Actual exam question from Python Institute's PCAP
Question #: 46
Topic #: 1
[All PCAP Questions]

Assuming that the V variable holds an integer value to 2, which of the following operators should be used instead of OPER to make the expression equal to 1?

V OPER 1 -

  • A. <<<
  • B. >>>
  • C. >>
  • D. <<
Show Suggested Answer Hide Answer
Suggested Answer: C 🗳️

Comments

Chosen Answer:
This is a voting comment (?) , you can switch to a simple comment.
Switch to a voting comment New
apextek1
Highly Voted 4 years, 2 months ago
answer is C
upvoted 15 times
...
Damon54
Most Recent 3 months, 2 weeks ago
V = 2 V = V >> 1 print(V)
upvoted 1 times
...
Netspud
1 year, 3 months ago
Selected Answer: C
It's C
upvoted 1 times
...
macxsz
2 years ago
Selected Answer: C
answer: C. >>
upvoted 1 times
...
rocky48
2 years, 2 months ago
Selected Answer: C
V = 2 V >> 1 print(V)
upvoted 1 times
...
rbishun
2 years, 6 months ago
print(0b10) # is 2 in decimal print(2 >> 1) # shift 1 bit to the right returns 1 in decimal # Thus C is the correct answer.
upvoted 1 times
...
FR99
3 years, 7 months ago
Answer C is the CORRECT one
upvoted 2 times
...
imsaad
3 years, 9 months ago
should be C
upvoted 1 times
...
sacnar
3 years, 9 months ago
answer should be C
upvoted 1 times
...
john_bosco_champion
3 years, 9 months ago
V = 2 # Assigns the value of 2 to variable V print(bin(V)) # Prints the current value of V in binary print(V) # Prints the current value of V in decimal V = V >> 1 # Checking the new value of V after the bitwise right shift of int(2) i.e (from 0b10 to 0b01) print(bin(V)) # Prints the new value of V in binary print(V) # Prints the new value of V in decimal OUTPUT 0b10 2 0b1 1 Hence, the answer is C
upvoted 3 times
...
imsaad
3 years, 9 months ago
Answer A is syntax error, C is the right answer
upvoted 1 times
...
guillepowermetal
3 years, 11 months ago
Answer A is not even possible, syntax error
upvoted 2 times
...
Amritansh
3 years, 11 months ago
V = 2 V >> 1 print(V) answer is C
upvoted 3 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 ...