Advertisement
Aikiro42

burBURGERger

Feb 14th, 2020
266
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.73 KB | None | 0 0
  1. def burger(n, i=1):
  2.     width = 2*i + 3
  3.     padding = n - i
  4.     top_bun = ' '*padding + '/'+'‾'*(width - 2)+'\\'
  5.     lettuce = ' '*padding + '~'*width
  6.     patty = ' '*padding + '='*width
  7.     pickles = ' '*padding + 'o'*width
  8.     bottom_bun = ' '*padding + '\\'+'_'*(width - 2)+'/'
  9.  
  10.     print(top_bun)
  11.  
  12.     if i % 3 == 1:
  13.         print(lettuce)
  14.    
  15.     if i % 2 == 0:
  16.         [print(patty) for _ in range(i//2)]
  17.     else:
  18.         [print(patty) for _ in range(i//2 + 1)]
  19.        
  20.     if i < n:
  21.         burger(n, i+1)
  22.  
  23.     [print(patty) for _ in range(i//2)]
  24.  
  25.     if i % 3 == 2:
  26.         print(pickles)
  27.  
  28.     print(bottom_bun)
  29.    
  30. n = int(input())
  31. cases = [int(input()) for _ in range(n)]
  32. [burger(case) for case in cases]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement