I am trying to create a single list with a tuple that contains integers
Examples of input:
test1((1, 2, 3), 2, 3)
test2((5, -5), 10, 3)
test3((10.2, -2.2, 0, 1.1, 0.5), 12.4, 3)
I have tried iterating through the tuple in various ways, but get a "int() is not iterable error". I tried to assign variables to inputs but get an "'type' object is not subscriptable" error.
I've rewritten the script many times now and don't have previous attempts saved. The unpack methods I've found on here don't work because they require me to iterate through the input, which I cannot do (or figure out how). b = [i for sub in args for i in sub]
, list(chain.from_iterable(args)
ect haven't worked.
Here is what I have now
def checkio(*args):
ab, cd, ef = args
print (ab)
empty = []
empty.append(cd)
empty.append(ef)
for i in ab:
empty.append(i)
print (empty)
A bit of a mess. I'm quite new to python so I'm sure the solution is very simple