nerdexam
Python_Institute

PCAP-31-03 · Question #12

Which of the following expression evaluate to True? (Select two answers)

The correct answer is A. len('\'? == 1 C. chr(ordCA') + 1) == 'B'. print(ord('Z') - ord('z') == ord('0')) print(chr(ord('A') +1) == 'B' ) print(len('\~') == 1 ) print(len('') == 0 )

Technology and architecture

Question

Which of the following expression evaluate to True? (Select two answers)

Options

  • Alen(''? == 1
  • Blen("""""") == o
  • Cchr(ordCA') + 1) == 'B'
  • Dord("Z") - ord("z") -- ord("0")

How the community answered

(51 responses)
  • A
    75% (38)
  • B
    18% (9)
  • D
    8% (4)

Explanation

print(ord('Z') - ord('z') == ord('0')) print(chr(ord('A') +1) == 'B' ) print(len('~') == 1 ) print(len('') == 0 )

Topics

#Python strings#len function#chr ord functions#expression evaluation

Community Discussion

No community discussion yet for this question.

Full PCAP-31-03 Practice