Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import turtle
- y = 0 # if x is on top, line continues straight. If Y is on top, it zig zags
- char = 33 # Starts as the first character to be printed, is incrimented in every loop
- for j in range(10): # number of rows
- x = -100 # if these are below for statement turtle stays on the line and continues 10 times
- for i in range(1, 11): # limits to ten characters
- turtle.penup()
- turtle.goto(x, y) #coordinates to start at
- turtle.pendown()
- turtle.write(chr(char)) # use the variable that we defined before the loop to print the correct character
- char += 1 # add one to go to the next character
- x += 30 #distance between
- y += 30 #distance between rows
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement