Saturday, September 26, 2015

Lab5 - Display elements (value) of array and its index

def setup():
    n=[5,8,9,7,5,3,2,9]
    i=0
    print("Index is ",n[0])
    while(i<=len(n)):
        print("Value of n[",i,"] is ",n[i])
        i+=1

setup()

No comments:

Post a Comment