Untitled

mail@pastecode.io avatar
unknown
python
a year ago
479 B
2
Indexable
Never
Numbers = input("Please enter an array of integers")

NumSplit = Numbers.split(",")


print(NumSplit)

New_Numbers = []
for i in NumSplit:
    New_Numbers.append(int(i))
Numbers = New_Numbers

print (Numbers)


A = [Numbers]
result = 0
for number in range (1, len(A) ):
    if A[len(A)+2]-A[len(A)+1] > A[len(A)+1]-A[len(A)]:
        result = A[len(A)+2]-A[len(A)+1]
    elif A[len(A)+2]-A[len(A)+1] <= A[len(A)+1]-A[len(A)]:
        result = A[len(A)+1]-A[len(A)]
print (result)