Expand tuple into arguments while casting them? [duplicate]
问题 This question already has answers here : Call int() function on every list element? (7 answers) Closed 4 years ago . I have this: blah = random.randint(int(minmax[0]), int(minmax[1])) I know this is possible: minimum, maximum = int(minmax[0]), int(minmax[1]) blah = random.randint(minimum, maximum) Can I do this second one in a single line using tuple-argument expansion? For example, if minmax was a tuple of integers to begin with, I could do: blah = random.randint(*minmax) But I don't have a