fork download
  1. def f(n):
  2. for i in range(0,len(n)):
  3. final_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.04s 9644KB
stdin
Standard input is empty
stdout
[8]
[8]
[6]
[6]
[6]