def find (target, items): 1-len (items) 1=0 while i<1: if target==items [i]: return i 1+=1 return -1 print (find (3, [1, 2, 3, 4, 5])) print (find (6, [1,2,3,4,5]))

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter14: Introduction To Swing Components
Section: Chapter Questions
Problem 10PE
icon
Related questions
Question

Please help, what's wrong with this code

■
PC
+0
08:56 PM
2022-08-11
le
File Edit Format Run Options Window Help
def find (target, items):
1=len (items)
1=0
while i<1:
if target==items [i]:
return i
1+=1
return -1
*umbuzo02.py - C:/Users/Ziyanda Madzidi/Downloads/Bachelor of Science/Third year 2022/umbuzo02.py (3.8.0)*
print (find (3, [1, 2, 3, 4, 5]))
print (find (6, [1, 2, 3, 4, 5]))
Ln: 12 Col: 0
Transcribed Image Text:■ PC +0 08:56 PM 2022-08-11 le File Edit Format Run Options Window Help def find (target, items): 1=len (items) 1=0 while i<1: if target==items [i]: return i 1+=1 return -1 *umbuzo02.py - C:/Users/Ziyanda Madzidi/Downloads/Bachelor of Science/Third year 2022/umbuzo02.py (3.8.0)* print (find (3, [1, 2, 3, 4, 5])) print (find (6, [1, 2, 3, 4, 5])) Ln: 12 Col: 0
Expert Solution
steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Knowledge Booster
Arrays
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT