Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
rui7257617yI believe u are using python language and the out put is 2 btw
L is an empty list
N is initalized to one
You have aloop that checks if n is less than 15
Inside your loop you append in L your N value you also add 1 to your N value each loop
Lastly you have print l[1] that access your L index 1 which is 2 -
Qujja2727ySince python arrays start with 0, the array will be like [1,2,3,...,14]. So the output is 2.
I hope this is correct; python isn't my language of choice
EDIT: what he said ^ 😁 -
I remember you (?) asked something similar before, are you trying to cheat your buddy, that is playing these challenges with you? 😉
Related Rants
-
hashit6Substitute Teacher who apparently majors in Java sees my copy. T - Your programs are incomplete M - You mean ?...
-
unknowndev110Came home to visit parents Dad - Internet on my laptop isn't working (I switched him on a Ubuntu platform beca...
-
FadedCoder15That weird moment when you don't understand what ++ or -- means in devRant cause you Python developer
Can you explain to me how it works?Please
question
python 3