Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- n = int(input("Enter the Starting Row of Numbers : "))
- str1, L1 = "", [1, 2, 3, 4, 5, 6, 7, 8, 9]
- j, start = 0, 0
- for i in L1:
- str1 += str(i)
- while n >= 1:
- end = start+n
- if end > len(str1):
- req_str = str1[start:]
- new_n = n-len(req_str)
- new_start = 0
- req_str += str1[new_start:new_start+new_n]
- else:
- req_str = str1[start:end]
- print(req_str)
- j += 1
- n -= 1
- start = str1.index(req_str[-1]) + 1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement