sample

Question 1

Time: 00:00:00
Which of the following operators cannot be used with strings?

+

+

-

-

*

*

+=

+=

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

Please login to submit your explanation

Start

Question 2

Time: 00:00:00
a=”Prep”
b=”Insta”
print(“InstaP” in 2*(a+b))

What is the output of the above code?

True

True

False

False

true

true

false

false

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

Please login to submit your explanation

Start

Question 3

Time: 00:00:00
print(ord(‘abc’))

What is the output of the above code?

97

97

97 98 99

97 98 99

65 66 67

65 66 67

Error

Error

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

Please login to submit your explanation

Start

Question 4

Time: 00:00:00

st="PrepInsta"
x=""
for i in st:
if(i.islower()):
x+=i.upper()
print(x)

What is the output of the above code?

PREPINSTA

PREPINSTA

pREPiNSTA

pREPiNSTA

REPNSTA

REPNSTA

REPINSTA

REPINSTA

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

Please login to submit your explanation

Start

Question 5

Time: 00:00:00
print(r”\nChocolate”)

What is the output of the above code?

rChocolate

rChocolate

r Chocolate

r Chocolate

\nChocolate

\nChocolate

None of the above

None of the above

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

Please login to submit your explanation

Start

Question 6

Time: 00:00:00
st="Cadbury Dairy Milk"
x=st.split('a')
print(len(x))

What is the output of the above code?

7

7

9

9

3

3

6

6

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

Please login to submit your explanation

Start

Question 7

Time: 00:00:00
st="An apple a day"
print(st.replace("a","x",2))

What is the output of the above code?

Xn xpple x day

Xn xpple x day

An xpple x day

An xpple x day

An xpple x dxy

An xpple x dxy

Xn apple x dxy

Xn apple x dxy

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

Please login to submit your explanation

Start

Question 8

Time: 00:00:00

st="Happy Christmas and Happy new year"
if(st.startswith("Happy")):
x=st.rsplit("Happy")
print(len(x))

What is the output of above code?

6

6

3

3

5

5

4

4

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

Please login to submit your explanation

Start

Question 9

Time: 00:00:00

import math
st="10.57"
x=st.zfill(10)
print(x.count("0"))


what will be the output of the above code?

5

5

10

10

7

7

6

6

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

Please login to submit your explanation

Start

Question 10

Time: 00:00:00

x="ababcabcab"
s=x.lstrip("ab")
print(len(s)*s.count("a"))


What will be output of the above code?

24

24

12

12

6

6

18

18

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!"]

Completed

0/0

Accuracy

0%