BhargavKadali39 / Python_Data_Structure_Cheat_Sheet

Clean representation of how every datatype in python should be used.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Python_Data_Structures_Cheat_Sheet

Data type Mutable Ordered Indexing Duplicate
List [ ] yes yes yes yes
Tuple ( ) no yes yes yes
Set { } no no no no
Dictionary { key : value } yes yes no no

Now what is the whole point of creating the cheatsheet in the first place you ask!

Using a little logical thinking here, anyone can crack many basic programs like removing duplicates from a list.
So how is it done you say!
let me explain

using set() method, that's it,
As we can observe from above,List allow Duplications but Set don't.
Go to the python file linked in this repo for detailed code.

You can use this to make projects like password generator but with no duplicate characters in it and much more.

  • From below you can copy if you want to 😉🥇.

    Data type        Mutable    Ordered   Indexing   Duplicate
    
    List [ ]          yes        yes       yes         yes
    
    Tuple ( )         no         yes       yes         yes
    
    Set { }           no         no        no          no
    
    Dictionary        yes        yes       no          no
    { key : value }
    

About

Clean representation of how every datatype in python should be used.


Languages

Language:Python 100.0%