Skip to content

Instantly share code, notes, and snippets.

@mrf345
Created October 23, 2017 14:58
Show Gist options
  • Save mrf345/428195bdcf0d76c1fa48ad25c1a614ea to your computer and use it in GitHub Desktop.
Save mrf345/428195bdcf0d76c1fa48ad25c1a614ea to your computer and use it in GitHub Desktop.
Function to draw a grid Python3
def quare(leng=4, height=4, hmh=2, hmv=2, counter=1):
if counter > hmv:
return True
def pit(inp, num):
print(inp * num)
pit("+" + "-" * leng + "+" + " ", hmh)
for a in range(height-1):
pit("|" + " " * leng + "|" + " ", hmh)
pit("+" + "-" * leng + "+" + " ", hmh)
return quare(leng, height, hmh, hmv, counter+1)
quare()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment