+ 1
explain this code
what is n=n || 1 why the biggertriple result is 36 https://code.sololearn.com/WPs9ukRAq9RL/?ref=app
2 Answers
+ 2
There're two classes in the code, one is the main class and the other class I'd call it the second class because it inherits from the main class(you can see this with the word extends). In second code it uses a super that is to use functions from the main function.
For triple() there is an option that the code gives use value of the user or 1, as there's not user value the code takes n as 1 multiply it by 3.
For triple(6) it's the same, but for BiggerTriple the program does 3*3*3*3 = 81
+ 1
thanks for help!