Can someone explane this example? Лучше на русском))) | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Can someone explane this example? Лучше на русском)))

why the answer is 28? https://code.sololearn.com/cYGxKsQ6wD2a/?ref=app

9th Apr 2018, 5:48 PM
andrey
andrey - avatar
3 Answers
+ 3
when calling the Geom class we are passing only one parameter as 4 and the second parameter is automatically taken as 10 as we are not passing any value so 4*2+10*2 results in 28
9th Apr 2018, 5:56 PM
kaliki chandu
kaliki chandu - avatar
+ 1
self ссылается сам на себя, первый параметр присваивается к h (height), а второй по дефолту 10 потому, что второго аргумента нету, 4*2 + 10*2. Итог 28 P.S. то же самое на русском )
9th Apr 2018, 5:59 PM
Sokrat_Poghosyan
Sokrat_Poghosyan - avatar
+ 1
thanks. i'm donkey)))))
9th Apr 2018, 6:01 PM
andrey
andrey - avatar