list1 = ["a", "b", "c", "d"]
list2 = ["1", "2", "3", "4"]
str1 = ""
for i in range(len(list1 )):
for j in range(len(list2 )):
if (i == j):
str1 = str1+ str(list1[i] + ":" + list2[j] +", ")
print str1
I want help for to get the result as a:1, b:2, c:3, d:4.
instead of a:1. b:2. c:3. d:4.
list2 = ["1", "2", "3", "4"]
str1 = ""
for i in range(len(list1 )):
for j in range(len(list2 )):
if (i == j):
str1 = str1+ str(list1[i] + ":" + list2[j] +", ")
print str1
I want help for to get the result as a:1, b:2, c:3, d:4.
instead of a:1. b:2. c:3. d:4.
Comment