fork download
  1. x = [7,9,5,6,3,6,2]
  2. n = len(x)
  3. def bubblesort(x):
  4. for j in range(len(x)):
  5. for i in range(len(x)-1):
  6. if(x[i+1]<x[i]):
  7. x[i],x[i+1]=x[i+1],x[i]
  8. print(x)
  9.  
  10. def seclarg(x):
  11. bubblesort(x)
  12. return x[n-1]
  13. print(seclarg(x))
  14.  
Success #stdin #stdout 0.02s 9044KB
stdin
Standard input is empty
stdout
[2, 3, 5, 6, 6, 7, 9]
9