+ 1

Difference between float and int

9th Jul 2022, 12:42 PM
Coding World
Coding World - avatar
6 odpowiedzi
+ 7
Integer and float are two different kind of datatype that stores different kind of numerical data in a particular variable. An integer is a number without a decimal point that means these are just a numbers like 1,2,34,344 etc. A float is a number with a decimal point that means these are just a numbers with points like 1.5,2.56,34.667,344.678 etc. Float datatype is used when more precision is required.
9th Jul 2022, 1:00 PM
AMRIT KUMAR
AMRIT KUMAR - avatar
+ 1
Int is like this 1,3,4,6,7 etc Float is like this 5.56,7.78,98.00000,799.9076995 etc
9th Jul 2022, 6:16 PM
Dharmendra Pandit
Dharmendra Pandit - avatar
0
Hi AJ
9th Jul 2022, 1:13 PM
Coding World
Coding World - avatar
0
A float has decimal points like 3.5, 6.7, 87.56, etc.... But a integer is a like a whole number which can be positive or negative like 67, 45, -4, -35, etc
10th Jul 2022, 6:18 PM
Trisha Bothra
Trisha Bothra - avatar
0
integers are numbers without a decimal point, whereas floats are numbers with a decimal point. An additional information : double is more precise than float , double can store 64 bits ( and float can store only 32 bits ) Double is for storing large numbers Enjoy your learning bro ❤️
10th Jul 2022, 11:43 PM
Mohamed Khalil Farhat
Mohamed Khalil Farhat - avatar
0
If you want to see something fun with floats in Python, look at the output of 1.0 + 2.0
11th Jul 2022, 1:08 AM
Chris
Chris - avatar