2018年3月20日 星期二

Conditional Statement

>>>
>>> if ( age < 15 ): print("1")
... else print("2)
  File "<stdin>", line 2
    else print("2)
             ^
SyntaxError: invalid syntax
>>> if ( age < 15 ):
...     print(1)
... else:
...     print(2)
...
2


>>> if ( age < 15 ):
...     print("y")
... else:
...     print("NNN")
...
y
>>>

注意排版

沒有留言:

張貼留言