Q.1.
What will be the output of the following Python code? print("Hello {nameand {name2}".format(name1='foo', name2='bin'))
Q.2.
What will be the output of the following Python code? print("Hello {0!r} and {0!s}".format('foo', 'bin'))
Q.3.
What will be the output of the following Python code? print("Hello {and {1}".format(('foo', 'bin')))
Q.4.
What will be the output of the following Python code? print("Hello {0[0]} and {0[1]}".format(('foo', 'bin')))
Q.5.
What will be the output of the following Python code snippet? print('The sum of {and {is {2}'.format(12))
Q.6.
What will be the output of the following Python code snippet? print('The sum of {0:b} and {1:x} is {2:o}'.format(12))
Q.7.
What will be the output of the following Python code snippet? print('{:,}'.format(1112223334))
Q.8.
What will be the output of the following Python code snippet? print('{:,}'.format('1112223334'))
Q.9.
What will be the output of the following Python code snippet? print('{:$}'.format(1112223334))
Q.10.
What will be the output of the following Python code snippet? print('{:#}'.format(1112223334))