Sep-11-2019, 05:52 PM
(This post was last modified: Sep-11-2019, 06:01 PM by YoungGrassHopper.)
(Sep-11-2019, 05:29 PM)perfringo Wrote: One could start with observing pyramid and trying to find pattern(s).
We can observe that:
- first column is numbers from 1, 9
- number of items in row equals to the row number/first number in row (row #1 has 1 number, row #2 has two numbers .... row #9 has 9 numbers)
- numbers in row are multipliers of first number of row (a.k.a row number)
It follows that integers i with values 1...9 are emitted, then i is multiplied with values j in range 1, i + 1.
Visually it can be represented:
- > 1 (i) -> 1 * 1 (j)
- > 2 (i) -> 2 * 1 (j), 2 * 2 (j)
- > 3 (i) -> 3 * 1 (j), 3 * 2 (j), 3 * 3 (j)
...
Thanks for your guidance perfringo I appreciate it. I saw the pattern that part was very obvious to me but for some reason I could not lay in down in code, I believe its because this is my very first nested for loop task and its very new to me, I am being hit with a crazy amount of new info the last week I started with a software engineering bootcamp last Thursday and I have never coded prior to that, so really this is a whole new world to me, I am like a neathandral who just found fire for the very first time lol so if I sound very stupid its because Im a super noob and I am trying my best to stay above water, all of the advice I have received so far means a great deal to me you guys are top shelf
(Sep-11-2019, 05:52 PM)buran Wrote:(Sep-11-2019, 05:45 PM)YoungGrassHopper Wrote: can you please explain how it works if you don't mind?https://docs.python.org/3/library/functions.html#print
Hey buran Thanks for the sample code and info I appreciate it, I will have a look at it soonest : )