Monday, May 11, 2015

Python Class 108 - Kapil Sharma

Cheet Sheet: 

1. List = Arrays.

   List = ["One","Two","Three"];
   print List[2];

2. Tuple() = List, but its cannot be changed. (Unmutable)/xyz[2]


3. Sets = Are similar to list, un-ordered collection of unqiue elements.

   No, duplicates.

4. Dictionaries{} = Arrays. Un-order collections of key value pairs.

   dict = {"Key":"Value"}

5. __XYZ = Is declaring local variable by adding "__"


6. pop / remove: Both do the same thing.

   But implementation is different. In "pop" user needs
   to give index id: xyz.pop(1) / xyz.remove("abc")

7. xyz.find("abc"): Give the location index id of the text. 


8. "is": For same value, like one = two = [1,2,3] its true.


9. "in": For checking true values, "s" in "Kiwi" its false.


Python GitHub Repo: https://github.com/bornfreesoul/Python

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Blockchain: 101 (By - Kapil Sharma)

 https://testing-mines.blogspot.com/2021/10/blockchain-101-by-kapil-sharma.html Blockchain through the following attributes: Distributed:  T...