xxxxxxxxxx
# Python program to print list
# without using loop
a = [1, 2, 3, 4, 5]
# printing the list using * operator separated
# by space
print(*a)
# printing the list using * and sep operator
print("printing lists separated by commas")
print(*a, sep = ", ")
# print in new line
print("printing lists in new line")
print(*a, sep = "\n")
xxxxxxxxxx
string = "a surprise to be sure but a welcome one"
my_list = string.split(" ")
xxxxxxxxxx
>>> 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