+ 2
Pattern qustion
1 1 2 1 1 2 3 2 1 1 2 3 4 3 2 1
6 Respostas
+ 7
print(' 1\n 1 2 1\n 1 2 3 2 1\n1 2 3 4 3 2 1')
+ 5
a = 5 #Input
tab = 10 #tab in pattern
for r in range(0, a):
b = []
print ' '*tab,
for c in range(0,2*r+1):
if c <= r:
b.append(c+1)
else:
b.append(2*r+1-c)
print ''.join(map(str,b))
tab -= 1
this will give the output as
1
121
12321
1234321
123454321
+ 4
@Kuba you can just print it as a multiline comment. It won't matter
+ 4
For i in range(5):
print((5-i)*" ",end="")
print(list(range(1,i))+list(range(i,0,-1)),sep=" ")
+ 2
@vengat
the pattern produced from your code produces list of elements ! Not the pattern described by the submitter
0
You need a code for it?