Re: Geht Varialeninhalte tauschen auch irgendwie anders?
Verfasst: Mo Nov 03, 2014 6:26 pm
Och wenn das so ist, dann wird das bei Prolog, Haskell etc. nicht viel anders aussehen
Programmieren lernen von Anfang an
https://www.proggen.org/forum/
Code: Alles auswählen
one, two = range(1,3)
(otherone, othertwo) = (one, two)
Code: Alles auswählen
otherone, othertwo = one, two
Code: Alles auswählen
>>> d = (one, two)
>>> type(d)
<type 'tuple'>
Code: Alles auswählen
onelement = (0, )
Code: Alles auswählen
>>> d = (0)
>>> type(d)
<type 'int'>