Regarding float and int

if the values that we need to input in a code for getting a result is in decimal values then do we write float or int ?
for eg if p = 2 then
int p
and when if p = 2.1 then
float p

yes you are right
for decimal values we have to use float

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.