In Python 3, you can print a bunch of objects*
with a variable number of objects as the first bunch of args:
For example:
print(192,168,178,42,sep=".")
Or for example:
print("09","03","2018",sep="-")
But like let's say I have a collection of [192,168,178,42]
and I want to pass that to printed with a separator...how do I "unbox it into formal arguments" (and I'm using the term loosely) into arguments?
Use the *
unpacking operator:
print(*[192,168,178,42],sep=".")
or with a variable:
mylist = [192,168,178,42]
print(*mylist, sep=".")
Output:
192.168.178.42
See here for more details on packing/unpacking in Python.