Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # *Arrow Pattern* solution by @CodingComputing
- size = 7 # Given parameter
- all_star_row = ['*'] * size # row consisting of all *
- for row_idx in range(size): # for each row to be printed
- row_chars = [' '] * size # initialize with all spaces
- row_chars[row_idx:] = all_star_row[row_idx:] # replace upper triangle with *s
- row_chars[size - 1 - row_idx] = '*' # put single stars at other diagonal
- row = ' '.join(row_chars) # join over space into printable row
- print(row) # print!
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement