newbie question convert C to python
Paul Rubin
http
Mon Feb 14 23:25:41 EST 2005
doodle4 at gmail.com writes:
> How do i handle this piece of code in python:
>
> # define vZero 15
> # define vOne 20
>
> unsigned int vTable[Zero][One]
>
> if(vGroup[vZero][vOne] == 0)
> {
> vGroup[vZero][vOne]--
> .....
> .....
> }
Simplest might be with a dictionary:
vGroup = {} # I assume you meant vGroup not vTable
if vGroup[(vZero, vOne)] == 0:
vGroup[(vZero, vOne)] -= 1
.....
.....
More information about the Python-list
mailing list