What will be the output of the following Python code? print("abcdef".center(10, '12'))
1. 12abcdef12
2. abcdef1212
3.1212abcdef
4.error
What will be the output of the following Python code? print("Hello {1} and {0}".format('bin', 'foo'))
1.Hello foo and bin
2.Hello bin and foo
3. Error
4.none of the mentioned
What will be the output of the following Python code? print("xyyzxyzxzxyy".count('xyy', -10, -1))
1.2
2. 0
3. 1
4.error
hat will be the output of the following Python code snippet? print('The sum of {0:b} and {1:x} is {2:o}'.format(2, 10, 12))
1.The sum of 2 and 10 is 12
2. The sum of 10 and a is 14
3.The sum of 10 and a is c
4.Error
What is the default value of encoding in encode()?
1.ascii
2.qwerty
3.utf-8
4.utf-16
What will be the output of the following Python code snippet? print(' '.isspace())
1.True
2.False
3.None
4.Error
What will be the output of the following Python code snippet? print(''''''.isspace())
1.True
2. False
3.None
4. Error
What will be the output of the following Python code snippet? print(''.isdigit())
1.True
2.False
3.None
4.Error
What will be the output of the following Python code snippet? print('0xa'.isdigit())
1.True
2.False
3.None
4.Error
What will be the output of the following Python code snippet? print('1.1'.isnumeric())
1. True
2.False
3. None
4.Error
What will be the output of the following Python code snippet? print('11'.isnumeric())
1. True
2.False
3.None
4.Error
What will be the output of the following Python code snippet? print('1@ a'.isprintable())
1. True
2.False
3.None
4.Error
What will be the output of the following Python code snippet? print('a@ 1,'.islower())
1.True
2.False
3.None
4. error
What will be the output of the following Python code snippet? print('abc'.islower())
1. True
2.False
3.None
4.Error
What will be the output of the following Python code snippet? print('for'.isidentifier())
1.True
2.False
3.None
4. Error
What will be the output of the following Python code snippet? print('HelloWorld'.istitle())
1.True
2.False
3.None
4.Error
What will be the output of the following Python code snippet? print('my_string'.isidentifier())
1.True
2.False
3.None
4.Error
What will be the output of the following Python code snippet? print('The sum of {0} and {1} is {2}'.format(2, 10, 12))
1.The sum of 2 and 10 is 12
2.Error
3.The sum of 0 and 1 is 2
4.none of the mentioned
What will be the output of the following Python code snippet? print('__foo__'.isidentifier())
1.True
2.False
3.None
4.Error
What will be the output of the following Python code snippet? print('{:#}'.format(1112223334))
1.1,112,223,334
2.111,222,333,4
3. 1112223334
4. 1112223334
What will be the output of the following Python code snippet? print('{:$}'.format(1112223334))
1. 1,112,223,334
2. 111,222,333,4
3.1112223334
4.error
What will be the output of the following Python code snippet? print('{:,}'.format('1112223334'))
1.1,112,223,334
2. 111,222,333,4
3.1112223334
4. error
What will be the output of the following Python code snippet? print('{:,}'.format(1112223334))
1. 1,112,223,334
2. 111,222,333,4
3.1112223334
4.error
What will be the output of the following Python code? print('a B'.isalpha())
1.True
2.False
3. None
4.Error
What will be the output of the following Python code? print('ab'.isalpha())
1.True
2.False
3.None
4.Error
What will be the output of the following Python code? print('ab,12'.isalnum())
1. True
2.False
3.None
4.error
What will be the output of the following Python code? print('ab12'.isalnum())
1.True
2. False
3.None
4.error
What will be the output of the following Python code? print('abc'.encode())
1.abc
2. ‘abc’
3.b’abc’
4.h’abc’
What will be the output of the following Python code? print('{0:.2}'.format(1/3))
1. 0.333333
2.0.33
3.0.333333:.2
4.Error
What will be the output of the following Python code? print("ab cd ef".expandtabs('+'))
1. ab+cd+ef
2. ab++++++++cd++++++++ef
3.ab cd ef
4.none of the mentioned
What will be the output of the following Python code? print("ab cd ef".expandtabs())
1. ab  cd  ef
2.abcdef
3.ab cd ef
4.ab cd ef
What will be the output of the following Python code? print("ab cd ef".expandtabs(4))
1.ab  cd  ef
2.abcdef
3.ab cd ef
4.ab cd ef
What will be the output of the following Python code? print("abcdef".center(7, '1'))
1.1abcdef
2. abcdef1
3. abcdef
4. error
What will be the output of the following Python code? print("abcdef".center(7, 1))
1.1abcdef
2.abcdef1
3. abcdef
4.error
What will be the output of the following Python code? print("abcdef".find("cd") == "cd" in "abcdef")
1.True
2. False
3.Error
4.none of the mentioned
What will be the output of the following Python code? print("abcdef".find("cd"))
1.True
2.2
3. 3
4.none of the mentioned
What will be the output of the following Python code? print("ccdcddcd".find("c"))
1.4
2. 0
3.Error
4.True
What will be the output of the following Python code? print("Hello {0!r} and {0!s}".format('foo', 'bin'))
1.Hello foo and foo
2.Hello ‘foo’ and foo
3.Hello foo and ‘bin’
4.Error
What will be the output of the following Python code? print("Hello {0} and {1}".format('foo', 'bin'))
1.Hello foo and bin
2. Hello {0} and {1} foo bin
3. Error
4.Hello 0 and 1
What will be the output of the following Python code? print("Hello {0} and {1}".format(('foo', 'bin')))
1. Hello foo and bin
2. Hello (‘foo’, ‘bin’) and (‘foo’, ‘bin’)
3. Error
4.None of the mentioned
What will be the output of the following Python code? print("Hello {name1} and {name2}".format('foo', 'bin'))
1. Hello foo and bin
2. Hello {name1} and {name2}
3. Error
4.Hello and
What will be the output of the following Python code? print("Hello {name1} and {name2}".format(name1='foo', name2='bin'))
1.Hello foo and bin
2.Hello {name1} and {name2}
3.Error
4. Hello and
What will be the output of the following Python code? print("Hello {} and {}".format('foo', 'bin'))
1. Hello foo and bin
2.Hello {} and {}
3.Error
4. Hello and
What will be the output of the following Python code? print("xyyzxyzxzxyy".count('xyy', 0, 100))
1.2
2.0
3.1
4. error
What will be the output of the following Python code? print("xyyzxyzxzxyy".count('xyy', 2, 11))
1. 2
2.0
3.1
4.error
What will be the output of the following Python code? print("xyyzxyzxzxyy".count('yy'))
1. 2
2. 0
3.error
4.none of the mentioned
What will be the output of the following Python code? print("xyyzxyzxzxyy".count('yy', 1))
1. 2
2. 0
3. 1
4.none of the mentioned
What will be the output of the following Python code? print("xyyzxyzxzxyy".count('yy', 2))
1. 2
2.0
3.1
4.none of the mentioned
What will be the output of the following Python code? print("xyyzxyzxzxyy".endswith("xyy"))
1. 1
2.True
3.3
4. 2
What will be the output of the following Python code? print("xyyzxyzxzxyy".endswith("xyy", 0, 2))
1. 0
2. 1
3.True
4.False