Hi there
I am translating PERL code into python and i am new on both language.I have one question if we have hash key reference in PERL like this way
$a->{b}
how we can traslate it into PYTHON?
and if we have this code $a->{$b} , how we translate it into PYTHON also?
Waiting for help. Thanks
Regards
Sarfraz

Recommended Answers

All 2 Replies

# Hashes/Arrays are known as Libraries in Python:
a = {}
a['b'] = 0
print(a)
print(a['b'])
# Hashes/Arrays are known as Libraries in Python:
a = {}
a['b'] = 0
print(a)
print(a['b'])

Thanks friend for guidance....

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.