Wir lernen Python Teil 1
Freitag, Juli 29th, 2011
$ python
Python 2.6.5 (r265:79063, Apr 16 2010, 13:57:41)
[GCC 4.4.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> 0 == None
False
>>> int(None)
Traceback (most recent call last):
File "
TypeError: int() argument must be a string or a number, not 'NoneType'
>>> bool(None)
False
>>> bool(0)
False
>>> bool(1)
True
>>> if None:
... print "is nicht"
...
>>>
>>> if 1:
... print "is nicht"
...
is nicht
>>> if "test" == "test2":
... print "nö"
...
>>> if "test" == "test":
... print "nö"
...
nö
>>> if "test" != "test":
... print "nö"
...
>>> for i in range(0,101)
File "
for i in range(0,101)
^
SyntaxError: invalid syntax
(mehr …)