Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def print_numbers(curr_num):
- if curr_num == 0:
- return
- print_numbers(curr_num - 1)
- print(curr_num, end="")
- def print_pattern(n, curr_num=1):
- print_numbers(curr_num)
- print()
- if curr_num < n:
- print_pattern(n, curr_num + 1)
- if curr_num > 1:
- print_numbers(curr_num - 1)
- print()
- n = int(input())
- print_pattern(n)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement