def setup():
n=[1,5,10,4,6,8,7,10,1,1,9,1]
print("the first index of maximum number = ",firstIndex(n))
def firstIndex(n):
i=0
index=0
max_n=n[0]
while(i<len(n)):
if(max_n<n[i]):
max_n=n[i]
index=i
i=i+1
return index
setup()
ไม่มีความคิดเห็น:
แสดงความคิดเห็น