Advertisement
aid8

PatternPy

Aug 21st, 2019
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.27 KB | None | 0 0
  1. h = int(input("Height: "))
  2. Total = 0
  3. for row in range(h):
  4.     for col in range (h):
  5.         if(row == h-1 or col == 0 or row == col):
  6.             print ("*", end = " ")
  7.             Total += 1
  8.         else:
  9.             print(end = "  ")
  10.     print()
  11. print("Total: ", Total)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement