Hi there
I am translating PERL code into PYTHON Code
My PERL code is

if ( my $client = $dealing_clients->{ $data->{fundId} } )

And i translated it into python as

if (client = dealing_clients[data["fundId"]]):

But it is giving my following Error
"Syntax Error While detecting Tuple"

Any one know how to fix this error and why i am getting this error?
Waiting for guidance. Thanks in advance.

Regards
Sarfraz

try

if client == dealing_clients[data["fundId"]]:

() <- it's a tuple, or an immutable list.
= <- assign operator, you should never use that in a if statement. I'm going to guess you meant an compare operator, which is ==

try

if client == dealing_clients[data["fundId"]]:

() <- it's a tuple, or an immutable list.
= <- assign operator, you should never use that in a if statement. I'm going to guess you meant an compare operator, which is ==

HI
Its worked. Thanks buster....

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.