home
clear breadcrumbs
search
login
 
iteration
#!/usr/bin/python3 print("Content-Type: text/html") # HTML is following print() # blank line, end of headers import cgitb import numpy as np cgitb.enable() lst = [10, 50, 75, 83, 98, 84, 32] # range for x in range(len(lst)): print(lst[x]) print("
") # for for x in lst: print(x) print("
") [print(x) for x in lst] print("
") # while x = 0 while x < len(lst): print(lst[x]) x = x+1 print("
") # numPy n = np.arange(16) for x in np.nditer(n): print(x) print("
") # enumerate for x, res in enumerate(lst): print (x,":",res) print("
") # lambda res = list(map(lambda x:x, lst)) print(res)