每日一题(10)

上一篇 / 下一篇  2007-10-19 14:06:37 / 个人分类:每日一题

17. The ____ operator returns True if either of its operands can be evaluated as True, but not both.

Your Answer: ____________________________

Answer:

 The right answer here is the exclusive-or (xor) operator.

 

18. How does the identity ōperator === compare two values?

A. It converts them to a common compatible data type and then compares the resulting values

B. It returns True only if they are both of the same type and value If the two values are strings, it performs a lexical comparison

C. It bases its comparison on the C strcmp function exclusively

D. It converts both values to strings and compares them

Answer:

The identity operator works by first comparing the type of both its operands, and then their values. If either differ, it returns False—therefore, Answer B is correct.


TAG: 每日一题

 

评分:0

我来说两句

显示全部

:loveliness: :handshake :victory: :funk: :time: :kiss: :call: :hug: :lol :'( :Q :L ;P :$ :P :o :@ :D :( :)

数据统计

  • 访问量: 16944
  • 日志数: 87
  • 建立时间: 2007-09-29
  • 更新时间: 2008-04-15

RSS订阅

Open Toolbar