En büyük eleman kaçıncı indekste

This commit is contained in:
Mert Gör ☭ 2023-05-29 17:48:54 +03:00
parent eb63944f46
commit dcf9d9a8a7
No known key found for this signature in database
GPG Key ID: 2100A876D55B39B9
1 changed files with 8 additions and 0 deletions

View File

@ -0,0 +1,8 @@
a = [12, 34, 2, 78, 4, 30, -9, 44, 88, 41, 20]
mi = 0
for i, x in enumerate(a):
if x > a[mi]:
mi = i
print(f'En büyük eleman: {a[mi]}, indeksi: {mi}')