Aug-08-2020, 04:54 PM
(Aug-08-2020, 09:08 AM)Intr0spective Wrote: Hi,Well You Had A Good Approach!
The below is my interpretation of the code, I am obviously not saying that there is anything wrong with the OP's code.
I actually learnt a lot about print() tinkering with his code as well as for ndc85430 reply.
"""Sat 08/08/2020 at 09:02, my attempt at OP's code from a forum question.""" def get_pattern(num): """Return a list of pattern based on supplied argument.""" pattern = [] for i in range(0, num): pattern.append(num) return pattern for n in range(1, 6): #pattern = get_pattern(n) #print(*pattern, sep='') print(*get_pattern(n), sep='')Can someone advise if my code is ok or there is something that should be done differently?
Kind of like a simple feedback?
Using Def Function To Print Patterns