Advertisement
Guest User

Untitled

a guest
Oct 26th, 2016
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.44 KB | None | 0 0
  1. #Use with example 3.
  2. size = 3
  3.  
  4. #1. Create Empty 3x3 Grid
  5. list = ["-","-","-"]
  6.  
  7. #2. Show element 3
  8. list = ["-","-","3"]
  9.  
  10. #3. use a FOR statement to define the grid
  11. #list = ["e" for col in range(size)]
  12.  
  13.  
  14. #4. Change some of the cells in the grid
  15. list[1] = "B"
  16. list[2] = "B"
  17.  
  18.  
  19. #5. this prints the list
  20. for x in range(size):
  21.     #print(list[x])             #for vertical printing
  22.     print(list[x] ,end=chr(9)) #for horizontal printing
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement