Anirudha
← Work
15 Days of CodingDay 2September 5, 2025~2 min read

Data Types, Math Functions

Boolean is case sensitive, f”{}”

Day 2 had a focus on the primitive data types in Python. I read about strings, float, integers. What makes total sense when we think about it is that we can’t mix two different data types together in Python. This should be obvious but is often missed which leads to the dreaded red lines in the terminal. This can easily be avoided by first using the type() function to know the type of data integer and then using type conversions like float(), int(), string(), etc.

Basic mathematical operations are already built in Python and can be used directly. An interesting thing in Python is that we can use divide (/) operator and the results are float but if we use (//), then the results are integers. This is also similar for multiplication (*) and (**) operators. Round() function also uses the same logic and can be used as an alternate.

Assignment operators like +=, -=, *=, /= can be used to keep a running count for the variables and can make our code easier to understand. f-Strings are pretty interesting as they can be used to insert a variable or an expression into a string thereby effectively mixing two different data types together which goes totally against what we learned before. Well, exceptions make the rule!

In the project for the day, we programmed a bill splitter (lookout Splitwise, I am coming for you). The basic function of this program is to take the bill value, the percentage of tip we want to give and the number of people splitting the bill and it gives an amount that each person has to pay. Simple, easy and no quick math required to know the amount needed to pay.

On a side note, after work, we went to Ikea to pick some stuff up which made us late for dinner and the subsequent clean up. I was extremely close to giving up and not doing any Python but I stuck to it and I am glad I did. Mainly to cross off the day on my 100 days of code tracker but eh, whatever works and gives you the motivation to do a task. Do it! You got this!