difference between 2f and 2f 2f in python

Solutions on MaxInterview for difference between 2f and 2f 2f in python by the best coders in the world

showing results for - "difference between 2f and 2f 2f in python"
Jérémie
20 Oct 2016
10 == false   // true
20 === false  // false, because they are of a different type
31 == "1"     // true, automatic type conversion for value only
41 === "1"    // false, because they are of a different type
5null == undefined // true
6null === undefined // false
7'0' == false // true
8'0' === false // false
Martín
22 Jan 2020
1# They are both similar in function, however the for loop will retain a variable.
2# FOR Example:
3nums = [1,2,3]
4
5for n in nums
6	puts n
7end
8=> 1 2 3
9
10# If you ask what is n, n outputs the last assignment from the function.
11n => 3
12
13# EACH Example:
14
15nums.each do |i|
16	puts i
17end
18=> 1 2 3
19
20# If you ask what is i.
21i => NameError (undefined local variable or method `i' for main:Object)
22
Christian
14 Apr 2017
1#this operator(//) return the quotien of the division , specifically the int quotein
2print(5//2)
3# 2 
4#this operator(/) return us the exact solution no matter if its float type or anything
5print(5/2)
6# 2.5
Lucas
29 Oct 2017
1# The true div operator (//) return the quotien of a division
2print(5 // 2)
3# 2
4
5# The modulo operator (%) returns the reminder of a division
6print(5 % 1)
7# 1
Sophie
21 Nov 2018
1print(7/3)# this will lead to be a decimal answer
2print(7//3)#This will leade to be a int number because using // I requeted 
3#python to remove decimal number from the calculated resuld if it has
similar questions
queries leading to this page
difference between 2f and 2f 2f in python