python print space separated list code example
Example 1: take space separated int input in python
inp = list(map(int,input().split()))
Example 2: python list comma separated string
hobbies = ["basketball", "football", "swimming"]
print("My hobbies are:") # My hobbies are:
print(", ".join(hobbies)) # basketball, football, swimming
Example 3: print list as space separated python
>>> marks = [12, 23, 34, 56]
>>> print(marks)
[12, 23, 34, 56]
>>> print(*marks)
12 23 34 56
// *[listName] can be used to pass all elememts as separate arguements