concept new list in category python
appears as: new list

This is an excerpt from Manning's book Tiny Python Projects: Learn coding and testing with puzzles and games.
A shorter solution uses a list comprehension, which is basically a one-line
forloop inside square brackets ([]) that results in a newlist(see figure 4.8).def main(): args = get_args() jumper = {'1': '9', '2': '8', '3': '7', '4': '6', '5': '0', '6': '4', '7': '3', '8': '2', '9': '1', '0': '5'} print(''.join([jumper.get(char, char) for char in args.text]))
