Advertisement
dennoh

Pattern challenge o

Dec 28th, 2019
229
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.27 KB | None | 0 0
  1. list = ['A','B','C','D','E','F','G']
  2.  
  3. start=0
  4. end=len(list)
  5. while start <end:
  6.   new_list=list[:end-start]
  7.   res =''.join(new_list) + ' ' *(start *2 - 1) + ''.join(new_list[::-1])
  8.   if start==0:
  9.     res=res.replace(list[-1], '', 1)
  10.   print(res)
  11.   start +=1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement