File: class/Workbook/Exercises/Lab3/ex4d.py

X = 5
L = []
for i in range(7): L.append(2 ** i)
print L

if (2 ** X) in L:
    print (2 ** X), 'was found at', L.index(2 ** X)
else:
    print X, 'not found'



[Home page] Books Code Blog Python Author Train Find ©M.Lutz