9447387064 | 9847003556
0471-2335855 | 8089080088 | 0471-2334855 SEARCHING FOR ACADEMIC PROJECT?
9447387064 | 9847003556
0471-2335855 | 8089080088 | 0471-2334855    ### PYTHON QUESTIONS : PART 4

Which is the correct operator for power(x^y)?

X'y

X**y

x^^y

None of the mentioned

SHOW ANSWER

The output of the expression is:

bin(29)

'Ob10111'

'Ob11101'

'Ob11111'

'Ob11011'

SHOW ANSWER

Which of the following represents the bitwise XOR operator?

&

^

|

!

SHOW ANSWER

What is the order of precedence in python?

i)Parentheses

ii) Exponential

iii) Division

iv) Multiplication

v) Addition

vi) Subtraction

i,ii,iii,iv,v,vi

ii,i,iii,iv,v,vi

ii,i,iv,iii,v,vi

i,ii,iii,iv,vi,v

SHOW ANSWER

Operators with the same precedence are evaluated in which manner?

Left to Right

Right to Left

Cant say

None of the mentioned

SHOW ANSWER

Consider the expression given below. The value of X is:

X=2 +9*((3*12) - 8)/10

30.0

30.8

28.4

27.2

SHOW ANSWER

What is the value of the expression

Boat(4+int(2.39)%2)

5.0

5

4.0

4

SHOW ANSWER

What is the output of the following code?

if None

print("Hello")

False

Hello

Nothing will be printed

Syntax error

SHOW ANSWER

The if...elif-else executes only one block of code among several blocks

True

False

It depends on expression used

There is no elif statement in Python

SHOW ANSWER

What is the output of the code shown below?

if (9<0) and (0<-9):

print("hello")

elif (9 > 0) or False:

print("good")

else:

print(bad)

error

hello

good

bad

SHOW ANSWER

What is the output of the following?

for in range(10):

if i=5:

break

else:

print(i)

else:

print("Here")

0 1 2 3 4 Here

0 1 2 3 4 5 Here

0 1 2 3 4

1 2 3 4 5

SHOW ANSWER

In Python, for and while loop can have optional else statement?

Only for loop can have optional else statement

Only while loop can have optional else statement

Both loops can have optional else statement

Loops cannot have else statement in Python

SHOW ANSWER

What is the output of the following code?

i= sum= 0

while i<=4:

sum +=i

i=i+1

print(sum)

0

10

4

None of the above

SHOW ANSWER
BACK | NEXT
TRINITY SOFTWARE SOLUTIONS,IInd floor, Radheyam Towers, Gandhari Amman Kovil Road, Pulimood, Trivandrum - 1
0471-2334855 | 2335855 | 9447387064 | 9847003556 info@trinitytechnology.in