Calling “del” on result of Function call results in “SyntaxError: can't delete function call”
问题 Consider below example: random_tile = random.choice(tiles) del random_tile It first assigns a random element from the list tiles to a variable, and then calls a function on that variable. Then if we want to shorten the code as follows: del random.choice(tiles) We would get a SyntaxError: can't delete function call . I tried eval() with no luck. How can this be solved? EDIT: What I am trying to do is to remove a element from the tiles list at random . I thought I found a more compact way of