Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
|
|
@ -0,0 +1,23 @@
|
|||
import tables
|
||||
|
||||
var t: Table[int,string]
|
||||
|
||||
t[1] = "one"
|
||||
t[2] = "two"
|
||||
t[3] = "three"
|
||||
t[4] = "four"
|
||||
|
||||
echo "t has " & $t.len & " elements"
|
||||
|
||||
echo "has t key 4? " & $t.hasKey(4)
|
||||
echo "has t key 5? " & $t.hasKey(5)
|
||||
|
||||
#iterate keys
|
||||
echo "key iteration:"
|
||||
for k in t.keys:
|
||||
echo "at[" & $k & "]=" & t[k]
|
||||
|
||||
#iterate pairs
|
||||
echo "pair iteration:"
|
||||
for k,v in t.pairs:
|
||||
echo "at[" & $k & "]=" & v
|
||||
Loading…
Add table
Add a link
Reference in a new issue