21. Oct 2020 |

Python OOP – objektorienteeritud programmeerimine

Kuna ma ise sellega olin aasta tagasi üsna hädas, sest pea lihtsalt ei võtnud seda abstraktsiooni nii lennult, siis laia pintsliga kirjutasin siia (võimete piires) natuke selgitustega töötavat objektorienteeritud Pythoni koodi:


Mõni objekt, mõni meetod ja natuke funktsionaalsust. Ehk on kellelegi veel abiks, kes aru ei saa, kuidas objektid töötavad. See võib sisaldada vigu igal pool aga noh, see ongi jam.

16. Nov 2019 |

Pentabonacci and other N-bonacci numbers

I had Python test on friday and one task was related to pentabonacci numbers. I still have not figured it out because I never trained such tasks.  You can find some information here and on GeeksForGeeks (by the way, it is really good explanation!).

But I now understand that without knowing this background it would have not been possible to solve this task despite it being 1 min task in Excel 🙂

Need to know: N-bonacci numbers with first N-1 initial terms set to 0 and Nth initial term set to 1. And everything that comes after is the sum of N previous numbers.

4. Sep 2019 |

W292 no newline at the end of file – how to fix

This is PEP8 error if you do not add an empty line to the end of your file.

Introduction excercise coded in Python 3. Pay attention to line 21.

Add an empty line to the end of your .py file (like in the picture line 21). Without any indent. This is it!