I dont understand ... is it only for python? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

I dont understand ... is it only for python?

can s.o explain that code? https://code.sololearn.com/cVifR0ybhcNu/?ref=app

5th Nov 2017, 6:36 AM
nichdiomajadoch
3 Answers
+ 6
You can read about the Pascal triangle here: https://en.m.wikipedia.org/wiki/Pascal%27s_triangle 1 1 1 1 2 1 1 3 3 1 1 4 6 4 1 The code prints consecutive powers of 11 which happen to be consecutive Pascal's triangle rows, digit-wise -- 11, 121, 1331, 14641... Answering your question -- no, it's not Python-specific, you can do that in any other language, too. The power operator (**) might be different or non-existent (you have to use pow() in C++), but the mechanism is the same.
5th Nov 2017, 6:41 AM
Kuba Siekierzyński
Kuba Siekierzyński - avatar
+ 5
Yes, or simply put 11**n
5th Nov 2017, 8:37 AM
Kuba Siekierzyński
Kuba Siekierzyński - avatar
0
i understand... it is (10 + 1)**n right?
5th Nov 2017, 7:09 AM
nichdiomajadoch