วันอังคารที่ 22 กันยายน พ.ศ. 2558

[LAB5-Draft] MAXVALUE (LAST)

def find_max_value_index(number):
    count = 0
    Max_Value = 0
    Index_Value = 0
    while(count < len(number)):
        if(number[count] > Max_Value):
            Max_Value = number[count]
        if(number[count] == Max_Value):
            Index_Value = count
        count = count + 1
    return Index_Value
           
def setup():
    number = [-2,6,5,6,3,-5,8,3,5,8]
    print(find_max_value_index(number))

setup()

ไม่มีความคิดเห็น:

แสดงความคิดเห็น