Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Python Mario again!
# create a mario pyramid in python!
from cs50 import get_int
def main():
# Prompt user for a positive number
while True:
n = get_int("enter a positive number: ")
if n > 0:
# Print out this many rows
for i in range(n):
# Print out this many columns
for j in range(n-(i+1)):
print(" ", end="")
for k in range(i+1):
print("#", end="")
print(" ", end="")
for l in range(i+1):
print("#", end="")
if __name__ == "__main__":
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment