Format string unused named arguments
Format string unused named arguments Question: Let’s say I have: action = ‘{bond}, {james} {bond}’.format(bond=’bond’, james=’james’) this wil output: ‘bond, james bond’ Next we have: action = ‘{bond}, {james} {bond}’.format(bond=’bond’) this will output: KeyError: ‘james’ Is there some workaround to prevent this error to happen, something like: if keyrror: ignore, leave it alone (but do …