A directory of Objective Type Questions covering all the Computer Science subjects. Here you can access and discuss Multiple choice questions and answers for various compitative exams and interviews.

61. What is the output of the following?
print("ab\tcd\tef".expandtabs())
a. ab cd ef
b. abcdef
c. ab\tcd\tef
d. ab cd ef
View Answer Report Discuss Too Difficult!
Answer: (a).ab cd ef

62. What is the output of the following?
print("ab\tcd\tef".expandtabs(4))
a. ab cd ef
b. abcdef
c. ab\tcd\tef
d. ab cd ef
View Answer Report Discuss Too Difficult!
Answer: (d).ab cd ef

63. What is the output of the following?
print("ab\tcd\tef".expandtabs('+'))
a. ab+cd+ef
b. ab++++++++cd++++++++ef
c. ab cd ef
d. none of the mentioned
View Answer Report Discuss Too Difficult!
Answer: (d).none of the mentioned

64. What is the output of the following?
print("abcdef".find("cd") == "cd" in "abcdef")
a. True
b. False
c. Error
d. none of the mentioned
View Answer Report Discuss Too Difficult!
Answer: (b).False

65. What is the output of the following?
print("abcdef".find("cd"))
a. True
b. 2
c. 3
d. None of the mentioned
View Answer Report Discuss Too Difficult!
Answer: (b).2

66. What is the output of the following?
print("ccdcddcd".find("c"))
a. 4
b. 0
c. Error
d. True
View Answer Report Discuss Too Difficult!
Answer: (b).0

67. What is the output of the following?
print("Hello {0} and {1}".format('foo', 'bin'))
a. Hello foo and bin
b. Hello {0} and {1} foo bin
c. Error
d. Hello 0 and 1
View Answer Report Discuss Too Difficult!
Answer: (a).Hello foo and bin

68. What is the output of the following?
print("Hello {1} and {0}".format('bin', 'foo'))
a. Hello foo and bin
b. Hello bin and foo
c. Error
d. None of the mentioned
View Answer Report Discuss Too Difficult!
Answer: (a).Hello foo and bin

69. What is the output of the following?
print("Hello {} and {}".format('foo', 'bin'))
a. Hello foo and bin
b. Hello {} and {}
c. Error
d. Hello and
View Answer Report Discuss Too Difficult!
Answer: (a).Hello foo and bin

70. What is the output of the following?
print("Hello {name1} and {name2}".format('foo', 'bin'))
a. Hello foo and bin
b. Hello {name1} and {name2}
c. Error
d. Hello and
View Answer Report Discuss Too Difficult!
Answer: (c).Error