1num = int(input("Enter the Number: "))
2k = 1
3for i in range(0, num):
4 for j in range(0, i+1):
5 print(k, end="")
6 k = k+1
7 print()
8
9# This code is contributed by Shubhanshu Arya (Prepinsta Placement Cell Student)
1num = int(input("Enter the Number: "))
2
3for i in range(1, num+1):
4 for j in range(0, num):
5 print(i, end="")
6 print()
7
8# This code is contributed by Shubhanshu Arya (Prepinsta Placement Cell Student)
1
2 python
3
4
5
6 import re
7text, pattern = input(), input()
8m= list(re.finditer("(?=(%s))"%pattern,text))
9if not m:
10 print((-1,-1))
11for i in m:
12 print((i.start(1),i.end(1)-1))
1rows = int(input("Enter the Number of rows: "))
2cols = int(input("Enter the Number of cols: "))
3
4for i in range(0, rows):
5 for j in range(0, cols):
6 if i == 0 or j == 0 or j == cols-1 or i == rows - 1:
7 print("3", end="")
8 else:
9 print(i, end="")
10 print()
11
12# This code is contributed by Shubhanshu Arya (Prepinsta Placement Cell Student)
1rows = int(input("Enter rows:"))
2cols = int(input("Enter Cols:"))
3
4for i in range(0, rows):
5 for j in range(0, cols):
6 if i==0 or j==0 or i == rows-1 or j == cols-1:
7 print("*", end="")
8 else:
9 print(" ", end="")
10 print()
11
12# This code is contributed by Shubhanshu Arya (Prepinsta Placement Cell Student)