I’ve started to learn programming Python (also i’m a beginner) and my code’s print result was “0”. Could someone explain why?
I mean, on my calculator hardware it results on something like “0.5555552”, this has anything to do with the Python Interpreter’s code?
The first thing you need to know about programming: stackoverflow.com. Any question you will ever have, somebody has already posted the answer there.
Once you are using python 3, you’ll find there are two types of division
Often you do want integer division, so use the // operator.
I really appreciate that explaining, thank you. I’ve already heard about StackOverflow but never searched through it very much, from now i’m going to take a look over it as probably will help me a lot.
You don’t even need to search for SO (Stack Overflow) specifically. It very often happens to be the first result in your search feed, especially when trying to search for something programming- or tech-related. Thinking about it, I have never searched for something using SO’s own search engine actually.
For example!
and here