ProgrammingHardTCS NQT · Wipro pattern
What is printed?
What is printed?
print(1e3, 1000.0 == 1e3, 10 ** -2)
- A. 1000 True 0.01
- B. 1000.0 False 0.01
- C. 1000.0 True 0.1
- D. 1000.0 True 0.01
Correct answer: D. 1000.0 True 0.01
1e3 is a float that prints as 1000.0, and 10 ** -2 is the float 0.01.
More Python Programming questions
- What is printed? python print(type(True + 1).name, type(2 1.0).name)
- What is printed? python print(list(enumerate(['x'], 1))[0][0] + 1)
- What is printed? python print(list('ab') == ['a', 'b'], 'ab' == ['a', 'b'])
- What is printed? python print(len(dict.fromkeys('aab')), list(dict.fromkeys('aab')))
- What is printed? python print([x for x in [1, 2, 3] for in range(x)])
- What is printed? python print(sorted(['b10', 'b9', 'a100', 'c2'], key=lambda s: (s[0], int(s[1:]))))