InfyTQ Libraries and Functions (Python) Quiz 3

Question 1

Time: 00:00:00

A=lambda x:bool(x%2)
print(A(20), A(21))

False True

False True

False False

False False

True True

True True

True False

True False

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Start

Question 2

Time: 00:00:00
import functools
arr=[1,2,3,4]
print(functools.reduce(lambda x,y:x*y,arr))

Error

Error

10

10

24

24

No output

No output

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Start

Question 3

Time: 00:00:00

arr=[1, -2, -3, 4, 5]
def f(x):
   return x<-1
m=map(f, arr)
print(list(m))

[False, False, False, False, False]

[False, False, False, False, False]

[False, True, True, False, False]

[False, True, True, False, False]

[True, False, False, True,True]

[True, False, False, True,True]

[True, True, True, True, True]

[True, True, True, True, True]

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Start

Question 4

Time: 00:00:00

def demo(var):
   return var%3!=0 and var%5!=0
mib=filter(demo, range(1, 29))
print(list(mib))


Guess the output

[1, 2, 4, 7, 8, 11, 13, 14, 16, 17, 19, 22, 23, 26, 28]

[1, 2, 4, 7, 8, 11, 13, 14, 16, 17, 19, 22, 23, 26, 28]

[1, 2, 4, 7, 8, 10, 13, 14, 16, 17, 19, 22, 23, 26, 28]

[1, 2, 4, 7, 8, 10, 13, 14, 16, 17, 19, 22, 23, 26, 28]

[1, 2, 4, 7, 8, 11, 13, 14, 16, 17, 19, 22, 24, 26, 28]

[1, 2, 4, 7, 8, 11, 13, 14, 16, 17, 19, 22, 24, 26, 28]

[1, 2, 4, 7, 8, 10, 13, 14, 16, 17, 19, 22, 24, 26, 28]

[1, 2, 4, 7, 8, 10, 13, 14, 16, 17, 19, 22, 24, 26, 28]

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Start

Question 5

Time: 00:00:00
Guess the Output

Tuple = tuple(['0', '1'],[1,2])

print(Tuple)

([‘0’, ‘1’] [1, 2])

([‘0’, ‘1’] [1, 2])

(’01’,12)

(’01’,12)

Error

Error

0,1,1,2

0,1,1,2

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Start

Question 6

Time: 00:00:00
What will be the output of the code:

num = 5678

print(list(map(list, [num])))

[5, 6, 7, 8]

[5, 6, 7, 8]

[5678]

[5678]

[[5], [6], [7], [8]]

[[5], [6], [7], [8]]

Error

Error

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Start

Question 7

Time: 00:00:00
Predict the output:

import math

print(math.fsum([.1 for i in range(25)]))

2.5

2.5

25

25

2

2

2.0000000000000005

2.0000000000000005

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Start

Question 8

Time: 00:00:00
What will be the output of the following code:

import datetime

dates=datetime.date(2020,7,20)

print(dates)

Error

Error

2020-07-20

2020-07-20

2020/07/20

2020/07/20

20/07/2020

20/07/2020

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Start

Question 9

Time: 00:00:00
 len(sys.argv), the output of the following line?

Error

Error

1

1

Junk value

Junk value

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Start

Question 10

Time: 00:00:00
What will be the output:

print(round(5.5676,2))

5.5

5.5

5.57

5.57

5

5

5.5, 2

5.5, 2

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Start

["0","40","60","80","100"]
["Need more practice!","Keep trying!","Not bad!","Good work!","Perfect!"]

Personalized Analytics only Availble for Logged in users

Analytics below shows your performance in various Mocks on PrepInsta

Your average Analytics for this Quiz

Rank

-

Percentile

0%

Completed

0/0

Accuracy

0%

Comments