Uploaded by email4 fun

python1

advertisement
*In Python, sequence is the generic term for an ordered set. There are several types of
sequences in Python, the following three are the most important.Python list method
list() takes sequence types and converts them to lists. This is used to convert a given
tuple into list.
*/ --> Floating point division
// --> Floor division
Python 2.7.10 vs. Python 3.5
print (2/3) ----> 0
0.6666666666666666 Python 3.5
Python 2.7print (2/3)
---->
Where as there is no differece between Floor division in both python 2.7 and in
Python 3.5
138.93//3 ---> 46.0
138.93//3 ---> 46.0
4//3
---> 1
4//3
---> 1
#Python 2.7
#Python 3.5
#Python 2.7
#Python 3.5
*Because // returns the rounded down number. 11/3 = 3,666666... the smaller int
number is 3 => 11//3 = 3 -11/3 = -3,66666... the smaller int number is -4 => -11//3 =
-4
Download