ProgrammingVery hardCAT · MBA placement
What is printed?
What is printed?
import keyword
print(keyword.iskeyword('match'), keyword.issoftkeyword('match'), keyword.iskeyword('None'), 'match'.isidentifier())- A. True True True True
- B. False True True True
- C. False False True True
- D. True True False True
Correct answer: B. False True True True
match is a soft keyword, so it is not in the hard keyword list but is in the soft keyword list. None is a hard keyword, and match is still a valid identifier.
More Python Programming questions
- What is printed? python print({'a': 1} | {'a': 2, 'b': 3}, {'a': 1} | {}, dict(a=1) == {'a': 1})
- What is printed? python print(format(1234567.891, ',.2f'), format(0.000123, 'e'), format(12, '>5'), format(3, '03'))
- What is printed? python print((1 + 2j) (3 - 1j), abs(3 + 4j), (1 + 2j).conjugate())
- What is printed? python print(list(zip([1, 2, 3], 'ab')), list(zip('ab', [1, 2, 3], [True])), len(list(zip())))
- What is printed? python try: list(zip([1, 2], [3], strict=True)) except ValueError: print('length mismatch') print(list(zip([1, 2], [3])))
- What is printed? python print([f'{i}{ch}' for i, ch in enumerate('ab', 1)])