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 }