Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1. What will be the output of the following Python code snippet if x=1? x < <2 a) 8 b) 1 c) 2 d) 4

1. What will be the output of the following Python code snippet if x=1?

x<<2

a) 8

b) 1

c) 2

d) 4

2. What will be the output of the following Python expression?

bin(29)

a) '0b10111'

b) '0b11101'

c) '0b11111'

d) '0b11011'

3. What will be the value of x in the following Python expression, if the result of that expression is 2?

x>>2

a) 8

b) 4

c) 2

d) 1

4. What will be the output of the following Python expression?

int(1011)?

a) 1011

b) 11

c) 13

d) 1101

5. To find the decimal value of 1111, that is 15, we can use the function:

a) int(1111,10)

b) int('1111',10)

c) int(1111,2)

d) int('1111',2)

6. What will be the output of the following Python expression if x=15 and y=12?

x & y

a) b1101

b) 0b1101

c) 12

d) 1101

7. Which of the following expressions results in an error?

a) int(1011)

b) int('1011',23)

c) int(1011,2)

d) int('1011')

8. Which of the following represents the bitwise XOR operator?

a) &

b) ^

c) |

d) !

9. What is the value of the following Python expression?

bin(0x8)

a) '0bx1000'

b) 8

c) 1000

d) '0b1000'

10. What will be the output of the following Python expression?

0x35 | 0x75

a) 115

b) 116

c) 117

d) 118

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Transport Operations

Authors: Allen Stuart

2nd Edition

978-0470115398, 0470115394

Students also viewed these Programming questions

Question

23 Evaluation and control of integrated marketing communications

Answered: 1 week ago