The output of the two codes shown below is the same. i. bin((2**16)-1) ii. '{}'.format(bin((2**16)-1)) a) True
View Question
What will be the output of the following Python code?
hex(255), int(‘FF’, 16), 0xFF
What will be the output of the following Python code? hex(255), int('FF', 16), 0xFF a) ...
View QuestionThe formatting method {1:<10} represents the ___________ positional argument, _________ justified in a 10 character wide field.
The formatting method {1:<10} represents the ___________ positional argument, _________ justified in a 10 character wide field. a) ...
View Question
What will be the output of the following Python code?
l=list(‘HELLO’)
p=l[0], l[-1], l[1:3]
‘a={0}, b={1}, c={2}’.format(*p)
What will be the output of the following Python code? l=list('HELLO') p=l[0], l[-1], l[1:3] 'a={0}, b={1}, c={2}'.format(*p) a) ...
View Question
What will be the output of the following Python code?
l=list(‘HELLO’)
‘first={0[0]}, third={0[2]}’.format(l)
What will be the output of the following Python code? l=list('HELLO') 'first={0[0]}, third={0[2]}'.format(l) a) ‘first=H, third=L’
View Question
The output of the two codes shown below is the same.
i. ‘{0:.2f}’.format(1/3.0)
ii. ‘%.2f’%(1/3.0)
The output of the two codes shown below is the same. i. '{0:.2f}'.format(1/3.0) ii. '%.2f'%(1/3.0) a) ...
View Question
What will be the output of the following Python code?
‘%x %d’ %(255, 255)
What will be the output of the following Python code? '%x %d' %(255, 255) a) ...
View Question
What will be the output of the following Python code?
‘{0:.2f}’.format(1.234)
What will be the output of the following Python code? '{0:.2f}'.format(1.234) a) ‘1’ b) ...
View Question
What will be the output of the following Python code?
‘{a}, {0}, {abc}’.format(10, a=2.5, abc=[1, 2])
What will be the output of the following Python code? '{a}, {0}, {abc}'.format(10, a=2.5, abc=[1, 2]) a) ...
View Question
What will be the output of the following Python code?
t = ‘%(a)s, %(b)s, %(c)s’
t % dict(a=’hello’, b=’world’, c=’universe’)
What will be the output of the following Python code? t = '%(a)s, %(b)s, %(c)s' t % dict(a='hello', ...
View Question