how to print list using for loop in python

Solutions on MaxInterview for how to print list using for loop in python by the best coders in the world

showing results for - "how to print list using for loop in python"
Isabel
07 Sep 2019
1list = [1,"bob",4,"life",5]
2# with loop
3for i in list:
4    print(i)  
5>>> 1
6bob
74
8life
95
10
11x = [print(i) for i in list]
12>>> 1
13bob
144
15life
165
17
18# without loop
19print(*list, sep = "\, ")
20>>> 1, bob, 4, life, 5
21
22print(' '.join(map(str, list)))
23>>> 1 bob 4 life 5