Choose a topic to test your knowledge and improve your Python skills
What will be the output of the following Python code? print("abcdef".center(7, 1))
What will be the output of the following Python code? print("abcdef".center(7, '1'))
What will be the output of the following Python code? print("abcdef".center(10, '12'))
What will be the output of the following Python code? print("xyyzxyzxzxyy".count('yy'))
What will be the output of the following Python code? print("xyyzxyzxzxyy".count('yy', 1))
What will be the output of the following Python code? print("xyyzxyzxzxyy".count('yy', 2))
What will be the output of the following Python code? print("xyyzxyzxzxyy".count('xyy', 0, 100))
What will be the output of the following Python code? print("xyyzxyzxzxyy".count('xyy', 2, 11))
What will be the output of the following Python code? print("xyyzxyzxzxyy".count('xyy', -10, -1))
What will be the output of the following Python code? print('abc'.encode())
What is the default value of encoding in encode()?
What will be the output of the following Python code? print("xyyzxyzxzxyy".endswith("xyy"))
What will be the output of the following Python code? print("xyyzxyzxzxyy".endswith("xyy", 0, 2))
What will be the output of the following Python code? print("ab cd ef".expandtabs())
What will be the output of the following Python code? print("ab cd ef".expandtabs(4))
What will be the output of the following Python code? print("ab cd ef".expandtabs('+'))
What will be the output of the following Python code? print("abcdef".find("cd") == "cd" in "abcdef")
What will be the output of the following Python code? print("abcdef".find("cd"))
What will be the output of the following Python code? print("ccdcddcd".find("c"))
What will be the output of the following Python code? print("Hello {0} and {1}".format('foo', 'bin'))
What will be the output of the following Python code? print("Hello {1} and {0}".format('bin', 'foo'))
What will be the output of the following Python code? print("Hello {} and {}".format('foo', 'bin'))
What will be the output of the following Python code? print("Hello {name1} and {name2}".format('foo', 'bin'))
What will be the output of the following Python code? print("Hello {name1} and {name2}".format(name1='foo', name2='bin'))
What will be the output of the following Python code? print("Hello {0!r} and {0!s}".format('foo', 'bin'))
What will be the output of the following Python code? print("Hello {0} and {1}".format(('foo', 'bin')))
What will be the output of the following Python code snippet? print('The sum of {0} and {1} is {2}'.format(2, 10, 12))
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))
What will be the output of the following Python code snippet? print('{:,}'.format(1112223334))
What will be the output of the following Python code snippet? print('{:,}'.format('1112223334'))
What will be the output of the following Python code snippet? print('{:$}'.format(1112223334))
What will be the output of the following Python code snippet? print('{:#}'.format(1112223334))
What will be the output of the following Python code? print('{0:.2}'.format(1/3))
What will be the output of the following Python code? print('ab12'.isalnum())
What will be the output of the following Python code? print('ab,12'.isalnum())
What will be the output of the following Python code? print('ab'.isalpha())
What will be the output of the following Python code? print('a B'.isalpha())
What will be the output of the following Python code snippet? print('0xa'.isdigit())
What will be the output of the following Python code snippet? print(''.isdigit())
What will be the output of the following Python code snippet? print('my_string'.isidentifier())
What will be the output of the following Python code snippet? print('__foo__'.isidentifier())
What will be the output of the following Python code snippet? print('for'.isidentifier())
What will be the output of the following Python code snippet? print('abc'.islower())
What will be the output of the following Python code snippet? print('a@ 1,'.islower())
What will be the output of the following Python code snippet? print('11'.isnumeric())
What will be the output of the following Python code snippet? print('1.1'.isnumeric())
What will be the output of the following Python code snippet? print('1@ a'.isprintable())
What will be the output of the following Python code snippet? print(''''''.isspace())
What will be the output of the following Python code snippet? print(' '.isspace())
What will be the output of the following Python code snippet? print('HelloWorld'.istitle())