ProgrammingModerateTCS CodeVita · Infosys HackWithInfy
What is printed?
What is printed?
print(list(enumerate('ab', start=5)))- A. [(0, 'a'), (1, 'b')]
- B. [(5, 'a'), (5, 'b')]
- C. [(4, 'a'), (5, 'b')]
- D. [(5, 'a'), (6, 'b')]
Correct answer: D. [(5, 'a'), (6, 'b')]
enumerate with start=5 numbers the items from 5, so 'a' gets 5 and 'b' gets 6.
More Python Programming questions
- What is printed? python print(int(3.99999999999999999), int(-0.9))
- What is printed? python print('{0}{1}{0}'.format('a', 'b'), '{:>3}'.format(7), '%%%d' % 5)
- What is printed? python print(bin(5 << 2), 5 >> 1, -5 >> 1, -5 // 2)
- What is printed? python print(1 if 0 else 2 if 3 else 4, 0 or '' or 'z', 0 and 'z')
- What is printed? python a = [1, 2, 3] b = a 2 b[0] = 9 print(a, b)
- What is printed? python s = 'xxxy' print(s.rstrip('y'), s.strip('x'), repr(s.lstrip('xy')))