+ 28
Patterns in python in reversed order
I believe sololearn is a community which also give assisstance. Im stucked here and needs help Im Trying to print this number pattern in this way 5, 545, 54345, 5432345, 543212345 Theres my code and thats howfar i could go now im stucked. https://code.sololearn.com/c0LSujY0t9Xi/?ref=app
7 Respuestas
+ 11
It's bad practice to print inside a function, and not return any value, here is how I did it:
def pattern(n):
l = [[n]]
for i in range(n-1, 0, -1):
l.append(l[-1]+[i])
for i in range(1, len(l)):
l[i]+=l[i][::-1][1:]
return l
print(pattern(5))
+ 20
Aymane Boukrouh thankx that will be of much help. Fixing it together
+ 19
David Ashton
I finally completed, thankx alot for taking out the time to answer
https://code.sololearn.com/cJdB2CPMLT44/?ref=app
+ 18
Bill i solved it half way not fully. Thats why i post it coz i need help with it
+ 6
Here are a couple of other ways
https://code.sololearn.com/cBNwGJK3tfu8
https://code.sololearn.com/cnJaCLjla45S
+ 3
looks like you solved it, kinda cool
+ 2
Of course, you can dm me if you need more help