ProgrammingModerateTCS NQT · Accenture

What is printed?

What is printed?
x = 'abc'
print(x.islower() and x.isalpha(), ''.isdigit())
  1. A. True True
  2. B. True False
  3. C. False False
  4. D. False True

Correct answer: B. True False

abc is all lowercase letters, so both checks pass. An empty string has no digits, so isdigit returns False.

More Python Programming questions

Exams that ask this topic