Answer the question
In order to leave comments, you need to log in
Which of the ways to assign values by condition is correct?
Again, controversy about the cleanliness of the code. What code snippet is the most acceptable and why? :)
Option 1
if 'token' in params:
_token = params['token']
else:
_token = config.token
_token = config.token
if 'token' in params:
_token = params['token']
_token = params['token'] if 'token' in params else config.token
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question