-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathArray1.py
More file actions
36 lines (26 loc) · 787 Bytes
/
Copy pathArray1.py
File metadata and controls
36 lines (26 loc) · 787 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
print("don")
# Python program to print list
# using for loop
a = [1, 2, 3, 4, 5]
# printing the list using loop
for x in range(len(a)):
print a[x],
###########################################################
# Python program to print list
# by Converting a list to a
# string for display
a =["Geeks", "for", "Geeks"]
# print the list using join function()
print(' '.join(a))
# print the list by converting a list of
# integers to string
a = [1, 2, 3, 4, 5]
print str(a)[1:-1]
###########################################################
# Python program to print list
# print the list by converting a list of
# integers to string using map
a = [1, 2, 3, 4, 5]
print(' '.join(map(str, a)))
print"in new line"
print('\n'.join(map(str, a)))