1rows = 6 #Pattern(1,121,12321,1234321,123454321)
2for i in range(1, rows + 1):
3 for j in range(1, i - 1):
4 print(j, end=" ")
5 for j in range(i - 1, 0, -1):
6 print(j, end=" ")
7 print()
1j="ramkumar"
2for i in range(len(j)):
3 for g in range(0,i+1):
4 print(j[g],end=' ')
5 print('')
6# end='' meaning (print the next answer , near the previous answer in same line)
7#answer 1 2 3 4 5 6 like this in same row or same line(in horizontal)
8
9
10
11name="ramkumar"
12for i in range(len(name)) :
13 print(name[0:i+1])
1def pattern(n):
2 for i in range(0,n):
3 for j in range(0, i+1):
4 print("* " , end="")
5 print("\r") pattern(5
1def pattern(n): for i in range(0,n): for j in range(0, i+1): print("* " , end="") print("\r") pattern(5)
1
2 python
3
4
5
6 import re
7v = "aeiou"
8c = "qwrtypsdfghjklzxcvbnm"
9print(*re.findall("(?=[%s]([%s]{2,})[%s])"%(c,v,c),input(), re.I) or [-1], sep="\n")
10