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

From 706 to 720 of 820

Q. xA + 0xB + 0xC)

a. 0xa0xb0xc

b. error

c. 0x22

d. 33

  • d. 33

Q. >>>print "%d %d" % (obj.o1, obj.o2)

a. none none

b. none 22

c. 22 none

d. error is generated

  • d. error is generated

Q. >>>print(temp.id)

a. 224

b. error

c. 12

d. none

  • c. 12

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
Subscribe Now

Get All Updates & News