[Tutor] creating dict of dict : similar to perl hash of hash
David Rock
david at graniteweb.com
Wed Mar 7 02:02:04 CET 2012
* Thomas Maier <hayzer at gmail.com> [2012-03-07 00:38]:
> Hi David,
> Mixed data types in nested data structure are possible in Perl as well:
> %hash = ();
> $hash{'mylist'} = [1,2,3];
> $hash{'mystring'} = 'string';
> $hash{'mynum'} = 4;
> $hash{'anotherhash'} = {};
> $hash{'anotherhash'}{'anotherstring'} = 'string2';
>
> Thomas
Hah. Fair enough :-)
--
David Rock
david at graniteweb.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 190 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/tutor/attachments/20120306/1f2ca679/attachment-0001.pgp>
More information about the Tutor
mailing list