The above solution using a separator and terminator works well, but if you want to try another approach, you can do it without using the separator.
func test(items: Any...) {
for item in items {
print(item, terminator: " ")
}
print()
}