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

Exam PCAP All Questions

View all questions & answers for the PCAP exam

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 (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
apextek1
Highly Voted 4 years, 8 months ago
answer is C
upvoted 15 times
...
Damon54
Most Recent 9 months, 4 weeks ago
V = 2 V = V >> 1 print(V)
upvoted 1 times
...
Netspud
1 year, 9 months ago
Selected Answer: C
It's C
upvoted 1 times
...
macxsz
2 years, 6 months ago
Selected Answer: C
answer: C. >>
upvoted 1 times
...
rocky48
2 years, 8 months ago
Selected Answer: C
V = 2 V >> 1 print(V)
upvoted 1 times
...
rbishun
3 years, 1 month 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
4 years, 1 month ago
Answer C is the CORRECT one
upvoted 2 times
...
imsaad
4 years, 3 months ago
should be C
upvoted 1 times
...
sacnar
4 years, 3 months ago
answer should be C
upvoted 1 times
...
john_bosco_champion
4 years, 4 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
4 years, 4 months ago
Answer A is syntax error, C is the right answer
upvoted 1 times
...
guillepowermetal
4 years, 5 months ago
Answer A is not even possible, syntax error
upvoted 2 times
...
Amritansh
4 years, 5 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 ...