fork download
  1. size = input()
  2. kirjaimet = "0ABCDEFGHIJKLMNOPQRSTUVWXYZ"
  3.  
  4. ruudukko = []
  5. rivi = ['0']*(size*2-1)
  6.  
  7. for i in range(0,size): #produce n rows
  8. for y in range(0,i+1): #this row needs i+1 letters
  9. for z in range(0+i,size*2-1-i):
  10. rivi[z] = kirjaimet[size-i]
  11. print rivi, i
  12. ruudukko.append(rivi[:])
  13. print ruudukko
Success #stdin #stdout 0.01s 6360KB
stdin
5
stdout
['E', 'E', 'E', 'E', 'E', 'E', 'E', 'E', 'E'] 0
['E', 'D', 'D', 'D', 'D', 'D', 'D', 'D', 'E'] 1
['E', 'D', 'C', 'C', 'C', 'C', 'C', 'D', 'E'] 2
['E', 'D', 'C', 'B', 'B', 'B', 'C', 'D', 'E'] 3
['E', 'D', 'C', 'B', 'A', 'B', 'C', 'D', 'E'] 4
[['E', 'E', 'E', 'E', 'E', 'E', 'E', 'E', 'E'], ['E', 'D', 'D', 'D', 'D', 'D', 'D', 'D', 'E'], ['E', 'D', 'C', 'C', 'C', 'C', 'C', 'D', 'E'], ['E', 'D', 'C', 'B', 'B', 'B', 'C', 'D', 'E'], ['E', 'D', 'C', 'B', 'A', 'B', 'C', 'D', 'E']]