Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #Use with example 3.
- size = 3
- #1. Create Empty 3x3 Grid
- list = ["-","-","-"]
- #2. Show element 3
- list = ["-","-","3"]
- #3. use a FOR statement to define the grid
- #list = ["e" for col in range(size)]
- #4. Change some of the cells in the grid
- list[1] = "B"
- list[2] = "B"
- #5. this prints the list
- for x in range(size):
- #print(list[x]) #for vertical printing
- print(list[x] ,end=chr(9)) #for horizontal printing
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement