The "floor" command

Some times, while calculating, we need only the integer part of the earlier step for the next step.

The “floor” command gives the necessary effect. In the small example given below, we find the day number in an year if  full date is given.

Here is the example code:


year=input(“Give year number: “)
month=input(“Give month number: “)
date=input(“Give date: “)
n1=floor(275*month/9);
n2=floor((month+9)/12);
n3=(1+floor((year-4*floor(year/4)+2)/3));
% n is day of the year
n=n1-(n2*n3)+date-30;