We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 231773a commit 6d38d97Copy full SHA for 6d38d97
multlists.py
@@ -1,12 +1,22 @@
1
+"""
2
+ (c) Sergio Morales
3
+ CodeEval Challenge: Multiply Lists
4
+ Date Solved: 12/20/13
5
6
+
7
+#!/usr/local/bin/python3
8
9
import sys
10
11
test_cases = open(sys.argv[1], 'r')
12
for test in test_cases:
- list1 = test[0:test.find("|")-1]
- list2 = test[test.find("|")+1:]
13
+ list1 = test[0:test.find("|")-1].split(" ")
14
+ list2 = test[test.find("|")+2:len(test)-1].split(" ")
15
16
list1 = [int(x) for x in list1]
17
list2 = [int(x1) for x1 in list2]
18
- for i in range(0,len(list1)-1):
- print(list1[i]*list2[i]+" ", end="")
19
+ for i in range(0,len(list1)):
20
+ print(str(list1[i]*list2[i])+" ", end="")
21
print("", end="\n")
22
test_cases.close()
0 commit comments