I am trying to achieve this:
myString = "%s" % ("banana" if myDict['fruit] not 'None' else: "NOT a banana")
I would like to keep this optimised and do the logic while generating the string. What would be the correct syntax to perform a logic inside a string generator.
Aucun commentaire:
Enregistrer un commentaire