Top 1000+ Solved Problem Solving and Python Programming MCQ Questions Answer

From 346 to 360 of 820

Q. >>>print("%s" % example[4:7])

a. wo

b. world

c. sn

d. rl

  • a. wo

Q. >>>print example

a. snow

b. snow world

c. error

d. snos world

  • c. error

Q. >>>max("what are you")

a. error

b. u

c. t

d. y

Q. >>>example.find("e")

a. error

b. -1

Q. >>>example.rfind("e")

a. -1

b. 4

c. 3

d. 1

Q. >>>example[::-1].startswith("d")

a. dlrowolleh

b. true

c. -1

d. none

  • b. true

Q. To concatenate two strings to a third what statements are applicable?

a. s3 = s1 . s2

b. s3 = s1.add(s2)

c. s3 = s1.    add    (s2)

d. s3 = s1 * s2

  • c. s3 = s1.    add    (s2)

Q. >>>chr(ord('A'))

a. a

b. b

c. a

d. error

Q. >>>print(chr(ord('b')+1))

a. a

b. b

c. c

d. a

Q. Which of the following statement prints hello\example\test.txt?

a. print(“hello\\example\\test.txt”)

b. print(“hello\\example\\test.txt”)

c. print(“hello\\”example\\”test.txt”)

d. print(“hello”\\example”\\test.txt”)

  • b. print(“hello\\example\\test.txt”)

Q. Suppose s is “\t\tWorld\n”, what is s.strip()?

a. \\t\\tworld\\n

b. \\t\\tworld\\n

c. \\t\\tworld\\n

d. world

  • d. world

Q. +2+3?

a. hello123

b. hello

c. error

d. hello6

  • c. error

Q. >>>print("A", end = ' ')

a. dcba

b. a, b, c, d

c. d c b a

d. d, c, b, a will be displayed on four lines

  • c. d c b a
Subscribe Now

Get All Updates & News