0

what is the difference between / and // ?

16th Jun 2018, 5:18 AM
Sohini Dutta
Sohini Dutta - avatar
3 odpowiedzi
+ 12
/ is for floating point division in Python 3. It returns a floating point number. print(4/2) => 2.0 // is for floor division. It returns an integer. print(4//2) => 2
16th Jun 2018, 5:30 AM
Nikhil
Nikhil - avatar
0
/ division 5/2=4 // single line comment
16th Jun 2018, 5:24 AM
Ibodullo Salimov
Ibodullo Salimov - avatar
0
/ is used to perform division between two numbers Eg: 4/2 = 2 // is used to display the quotient of a division Eg: 7//2 = 3
18th Jun 2018, 5:41 AM
santhosh