Monty @ The Python Coding Place @thepythoncodingplace.com · Nov 26

Need leading zeros to display your secret agent codes? No worries…Python's f-strings got you covered ``` >>> agent_id = 7 >>> agent_name = "James Bond" >>> f"Agent {agent_id:03}: {agent_name}" 'Agent 007: James Bond' ``` Note the format specifier `:03`

0 likes 0 replies

?