Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 7327eb3

Browse files
committed
shorten code
1 parent 3a62acc commit 7327eb3

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

‎search/linearSearch.py‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@ def linearSearch(listItem, key):
44
while position < len(listItem) and not flag:
55
if listItem[position] == key:
66
flag = True
7-
else:
8-
position += 1
7+
position += 1
98

109
return flag
1110

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /