7.9 使用 not 还可以用 not 把比较倒过来,表示相反的逻辑。 color = raw_input("Enter your favorite color: ")if color == "red" or color == "blue" or color == "green": print "You are allowed to play t...
9.2 单行注释 在任何代码行前面加上“#”符号就可以把它变成一个注释。(这个符号叫做数字符号,有时也叫做镑符号。) # 这是Python 程序中的一个注释print 'This is not a comment' 如果运行这两行代码,会得到下面的输出: This is not a comment 程序运行时第一行会被忽略。注释(以 # 字符...