Skip to content

Commit 5d7c352

Browse files
updated
1 parent b46ab50 commit 5d7c352

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

min-array.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,11 @@ def smallest_positive(in_list):
22
# TODO: Define a control structure that finds the smallest positive
33
# number in in_list and returns the correct smallest number.
44

5-
temp = in_list[0];
6-
7-
for i, value in enumerate (in_list):
8-
if value > 0:
9-
temp = value;
10-
break;
11-
12-
5+
temp = -1;
6+
137
for i, value in enumerate (in_list):
8+
if(temp < 0 and value > 0):
9+
temp = value
1410
if(value < temp and value > 0):
1511
temp = value
1612

0 commit comments

Comments
 (0)