On Fri, Aug 10, 2007 at 01:36:09AM -0700, frankje wrote: > > Hallo, > > Ik ben net begonnen met een cursus python op www.developer.com. Hier staat > echter een listing in waarop ik een foutcode krijg (zie hieronder): > > t1 = "a", > t2 = t1*2 > if ("b" in t2) > print "OK" > if ("a" in t2): > print "t2" > print t2 > print "length = ",len(t2) > > > De foutcode die ik krijg is: > > [EMAIL PROTECTED]:~/python$ python tuple05.py > File "tuple05.py", line 10 > if ("b" in t2) > ^ > SyntaxError: invalid syntax > [EMAIL PROTECTED]:~/python$ > > Weet iemand wat er hier fout is?
Als ik het paste in de python prompt (met een extra enter) werkt het prima hier: >>> t1 = "a", >>> t2 = t1*2 >>> if ("b" in t2): ... print "OK" ... >>> if ("a" in t2): ... print "t2" ... print t2 ... print "length = ",len(t2) ... t2 ('a', 'a') length = 2 >>> -- __________________________________________________ "Nothing is as subjective as reality" Reinoud van Leeuwen [EMAIL PROTECTED] http://www.xs4all.nl/~reinoud __________________________________________________ _______________________________________________ Python-nl mailing list Python-nl@python.org http://mail.python.org/mailman/listinfo/python-nl