concept list.append in category python
appears as: list.append

This is an excerpt from Manning's book Tiny Python Projects: Learn coding and testing with puzzles and games.
There are methods like list.append()andlist.extend()to add elements to alist. Uselist.pop()andlist.remove()to remove elements.
The solution in section 12.2 creates an empty
list, to which Ilist.append()the return fromchoose(). Another way to writelist.append()is to use the+=operator to add the right-hand value (the element to add) to the left-hand side (the list), as in figure 12.3.def main(): args = get_args() random.seed(args.seed) ransom = [] for char in args.text: ransom += choose(char) print(''.join(ransom))