fork download
  1. def f(n):
  2. final_n = []
  3. for i in range(0,len(n)):
  4. max = n[i]
  5. for x in range(i,len(n)):
  6. if n[x]>max:max=n[x]
  7. final_n.append(max)
  8. print(final_n)
  9. a=[2,8,4,3,6]
  10. f(a)
Success #stdin #stdout 0.03s 9640KB
stdin
Standard input is empty
stdout
[8, 8, 6, 6, 6]