I don't know if the title is the best for this question. (suggestions accepted)
I have a piece of code that gets 3 lists of integers from the user in three different lines and I was wondering if this code:
A, B, C = [int(a) for a in input().split()], [int(a) for a in input().split()], [int(a) for a in input().split()]
can be simplified in a pythonic way to something like:
A, B, C = [int(a) for a in input().split()]*3
I know that this incorrect code but, is there a way to do this?
the best solution I've thought about for now is:
A, B, C = [[int(a) for a in input().split()] for _ in range(3)]
I've been suggested that this might be a duplicate of this question and it's not, I'm not asking how to set multiple variables to the same value, the value is different but the function call is the same to get the values. This results in code with three statements that are identical on the right side of the = sign and just have different variable names, but the values are different.