Files
Laboratori-PY/Laboratorio7/esercizio5.py
2024-03-22 17:01:42 +01:00

26 lines
479 B
Python

def readInts():
ints = []
while True:
num = input("Inserisci un numero: ")
if num == "":
break
ints.append(int(num))
return ints
def main():
nums = readInts()
maxFound=False
for i in range(1, len(nums) -1):
if nums[i-1] < nums[i] > nums[i+1]:
print("Massimo locale all'indice", i)
maxFound = True
if not maxFound:
print("Non ho trovato massimi locali")
main()