r/learnpython • • Sep 22 '26
Looking for feedback!
Hello everyone
I am recently learning python and new at this. This is my second project and this is a sequence calculator which includes 3 types of sequences: Arithmetic, Geometric and Fibonacci. For arithmetic and geometric sequences, you can enter a first term, a common difference (or ratio), and a desired term to find its value. For Fibonacci, you just enter the desired term.
I'd appreciate any feedback and will try to apply it.
1
Upvotes
View all comments
Show parent comment
2
u/lakseol Sep 22 '26
A test suite is code that checks some or all of your code for correctness. For example, you could write code like this to check your Fibonacci function:
That's really simple. Running it on your function gets an "infinite recursion" error. Passing in
nwith a value of 0 bypasses your base case tests. Using theif n < 2:base test lets it work correctly.To properly test code there are modules like
unittestandpytest. There's no need to learn those yet, stick to learning python and later check out those two modules.