ProgrammingHardTCS NQT · Infosys
What is printed?
What is printed?
print(all(c.islower() for c in 'abc'), any(c.isdigit() for c in 'abc'), 'abc'.isascii() and 'é'.isascii())
- A. True True False
- B. True False True
- C. True False False
- D. False False False
Correct answer: C. True False False
Every letter in abc is lowercase, and none is a digit. The ASCII test is False because é is not ASCII.
More Python Programming questions
- What is printed? python from collections import deque d = deque('abc') d.rotate(1) d.appendleft('z') print(''.join(d), d.pop())
- What is printed? python print(len(bin(255)), bin(255).count('0'), bin(-255).count('1'))
- What is printed? python print('%s' % 'x' 3, '%s' 2 % ('a', 'b'), '%s' % ('x' 3))
- What is printed? python print(3 'a' + 'b', 'c' 3 + 'd')
- What is printed? python print(int(3.7 10), int(0.7 10), 3.7 10 == 37, 0.7 10 == 7)
- What is printed? python print(sorted([True, 2, 1.5, False, -1]))