Skip to content

Commit 10f905b

Browse files
authored
Update 1.py
1 parent 2a7342c commit 10f905b

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

7/1.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ def sequential_search(n, target, array):
55
# 현재의 원소가 찾고자 하는 원소와 동일한 경우
66
if array[i] == target:
77
return i + 1 # 현재의 위치 반환 (인덱스는 0부터 시작하므로 1 더하기)
8+
return -1 # 원소를 찾지 못한 경우 -1 반환
89

910
print("생성할 원소 개수를 입력한 다음 한 칸 띄고 찾을 문자열을 입력하세요.")
1011
input_data = input().split()

0 commit comments

Comments
 (0)