gs gs109 Python Strings - Python Strings - Quiz No.7
gs gs109 Python Quiz
This quiz belongs to book/course code gs gs109 Python of gs organization. We have 134 quizzes available related to the book/course Python. This quiz has a total of 10 multiple choice questions (MCQs) to prepare and belongs to topic Python Strings. NVAEducation wants its users to help them learn in an easy way. For that purpose, you are free to prepare online MCQs and quizzes.
NVAEducation also facilitates users to contribute in online competitions with other students to make a challenging situation to learn in a creative way. You can create one to one, and group competition on an topic of a book/course code. Also on NVAEducation you can get certifications by passing the online quiz test.
Question 1: What will be the output of the following Python code?
print("ab\tcd\tef".expandtabs())
ab cd ef
abcdef
ab\tcd\tef
ab cd ef
Question 2: What will be the output of the following Python code?
print("ab\tcd\tef".expandtabs(4))
ab cd ef
abcdef
ab\tcd\tef
ab cd ef
Question 3: What will be the output of the following Python code?
print("ab\tcd\tef".expandtabs('+'))
ab+cd+ef
ab++++++++cd++++++++ef
ab cd ef
none of the mentioned
Question 4: What will be the output of the following Python code?
print("abcdef".find("cd") == "cd" in "abcdef")
True
False
Error
None of the mentioned
Question 5: What will be the output of the following Python code?
print("abcdef".find("cd"))
True
2
3
None of the mentioned
Question 7: What will be the output of the following Python code?
print("Hello {0} and {1}".format('foo', 'bin'))
Hello foo and bin
Hello {0} and {1} foo bin
Error
Hello 0 and 1
Question 8: What will be the output of the following Python code?
print("Hello {1} and {0}".format('bin', 'foo'))
Hello foo and bin
Hello bin and foo
Error
None of the mentioned
Question 9: What will be the output of the following Python code?
print("Hello {} and {}".format('foo', 'bin'))
Hello foo and bin
Hello {} and {}
Error
Hello and
Question 10: What will be the output of the following Python code?
print("Hello {name1} and {name2}".format('foo', 'bin'))
Hello foo and bin
Hello {name1} and {name2}
Error
Hello and