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 = 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
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.
apextek1
Highly Voted 4 years, 8 months agoDamon54
Most Recent 9 months, 4 weeks agoNetspud
1 year, 9 months agomacxsz
2 years, 6 months agorocky48
2 years, 8 months agorbishun
3 years, 1 month agoFR99
4 years, 1 month agoimsaad
4 years, 3 months agosacnar
4 years, 3 months agojohn_bosco_champion
4 years, 4 months agoimsaad
4 years, 4 months agoguillepowermetal
4 years, 5 months agoAmritansh
4 years, 5 months ago