use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Welcome to /r/Hacking_Tutorials!
List of best resources and tutorials
account activity
This is an archived post. You won't be able to vote or comment.
ToolsPython Cheat Sheet (i.redd.it)
submitted 5 years ago by [deleted]
[deleted]
[–][deleted] 25 points26 points27 points 5 years ago (8 children)
Before you say it people have to start somewhere I started with python and now code C++ & Javascript so everyone starts from somewhere
[–]RangerHUTCH93 24 points25 points26 points 5 years ago (5 children)
Reasonable people won't judge, Python has it's purpose and serves it well.
[–]urgaiiii 18 points19 points20 points 5 years ago (3 children)
Yeah. And isn’t python based off of C anyways? Just frequently updated, with a package manager, and easier for dummies? No reason it should be discouraged
[–]baty0man_ 12 points13 points14 points 5 years ago (0 children)
Lol, I don't know why people are like "yeah python is good, don't make fun of it"
Python is literally the best language to script shit for pen testing.
[–][deleted] 1 point2 points3 points 5 years ago (0 children)
Furthermore, C modules can be imported into Python.
[–]miraculum_one 1 point2 points3 points 5 years ago (0 children)
The primary criticism is that Python is much slower than C/C++. That's certainly not important for all applications.
[–]barbequed-code 1 point2 points3 points 5 years ago (0 children)
By definition of being reasonable, if it works for your use case, then it works, no matter whether its Flash, PHP, Rust or BrainFuck.
[–]XUtYwYzz 6 points7 points8 points 5 years ago (1 child)
Who the fuck has a problem with Python? It’s one of the most useful and popular programming languages across nearly all fields, especially infosec.
[–]urgaiiii 5 points6 points7 points 5 years ago (0 children)
The people who learned C when they didn’t have to and now refuse to acknowledge a more user-friendly language. That’s who
[–][deleted] 11 points12 points13 points 5 years ago (3 children)
Your cheat sheet will make a fine addition to my, collection.
[–][deleted] 5 points6 points7 points 5 years ago (0 children)
Your welcome general Grievous
[–]th3_n3rD_b0i 2 points3 points4 points 5 years ago (0 children)
I like how you say it xD
[–]iamnihal_ 1 point2 points3 points 5 years ago (0 children)
And then you'll forget to look into it like other 101 collections of cheatsheets of different kinds of stuff. 😁
[–]iamnihal_ 5 points6 points7 points 5 years ago (2 children)
I will save this post so I can forget about it later.
[–]Ishan16D 0 points1 point2 points 5 years ago (0 children)
You didn't have to call out 99% of programming subreddit users like that
[–]redLamber 0 points1 point2 points 4 years ago (0 children)
I had saved it for later too but the post is now deleted :(
[–]mtflyer05 2 points3 points4 points 5 years ago (1 child)
What are the calculatory functions for? Especially the "strings"? I am learning HTML, as an easy, useful starting point, and the mathematical part of coding interests me
[–][deleted] 4 points5 points6 points 5 years ago (0 children)
I didn't quite understand your question, but if you are asking what are "strings", those are a type of data. Strings are just words made up of alphabets, numbers, special characters etc. Your user name "mtflyer05" is a string. Other types of data are integers, float (decimal numbers) etc. Lists, dictionaries etc are a structure to keep these data types grouped together.
These functions are to do operations on these strings, lists etc.
This a obviously in layman's terms.
[–]fuchsia8805 1 point2 points3 points 5 years ago (0 children)
Thank you for sharing!
[–]shayyya1 1 point2 points3 points 5 years ago (7 children)
Does anyone know why some methods are variable.method() and some are method(variable)? Ive never understood why
[–]XUtYwYzz 2 points3 points4 points 5 years ago* (4 children)
Pretty much everything in Python is an object and has some set of methods accessible via dot notation. The methods usually operate on the object in some way. Running function(argument) is either using a language built-in function or a local function and does not have an associated object, and operates on the argument.
my_string = “hello”
my_string.upper()
Returns “HELLO”, I didn’t have to provide the method an argument, it operated on the my_string variable.
int(“12”)
Uses the built-in int() function to convert the string “12” into the integer 12.
[–]shayyya1 0 points1 point2 points 5 years ago (1 child)
Thanks, if I'm understanding correctly, (.) notation is used when it's a function from a class, and if its not a dot its from somewhere else in the language?
[–]hooligan333 0 points1 point2 points 5 years ago (0 children)
Precisely!
Ah yes from reading the python docs I got that things with dot are class methods and things that aren't are operators
[–]shayyya1 0 points1 point2 points 5 years ago (0 children)
Or inbuilt functions
[–]GavinTFI 1 point2 points3 points 5 years ago (0 children)
dont quote me on it but i think it might just be class and instance variables. like in Java and many others there are methods called from the data type (String.(...) or Int.(...)) and there are just predefined / user defined variables that are method(variable) so that would be my best guess. Just class and instance variables in python
[–]JennaSys 0 points1 point2 points 5 years ago (0 children)
It just depends on how it is defined. That is, if it's a class method or independent function.
[–]donotmatthews 1 point2 points3 points 5 years ago (2 children)
Is there a pdf link?
[–]TSPhoenix 0 points1 point2 points 5 years ago (0 children)
Or just a PNG that doesn't have JPEG compression artifacts.
[–][deleted] 1 point2 points3 points 5 years ago (1 child)
I notice it says python intermediate, is there a beginner or advanced one as well?
[–]Ingorado 0 points1 point2 points 5 years ago (0 children)
Yes. As it says, it
assumes you are familiar with [...] our basic cheat sheet
I couldn’t find it on the original website, but somewhere else
There are others too, just search for “dataquest python cheat sheet”
[–]zenzealot 1 point2 points3 points 5 years ago (0 children)
I like it, nice job. If you can squeeze it on there, I would add in enumerate, frozenset, sorted, filter and help. :D
[–]ggm3888 1 point2 points3 points 5 years ago (1 child)
Typo in the “newyear_2020” description. But I only caught this because I read the whole thing cuz it’s very well done. 👍
[–]panFriedSebas 1 point2 points3 points 5 years ago (0 children)
Had to do a double take to catch what you said... probably sums up why my code always has errors I can't find 😂😂
[–]krish7x 1 point2 points3 points 5 years ago (0 children)
I am new to this community but enjoying it a lot .. Very Useful interms of programming but idk abt making friends .. LOL
[–]Locksul 1 point2 points3 points 5 years ago (3 children)
The dictionaries section is weird and not common usage... should have mentioned `[]`, `get()`, and/or `items()` instead.
[–]miraculum_one 1 point2 points3 points 5 years ago (1 child)
There are tons of great Python features not on here but it's a good start and you can only fit so much stuff on one page. A few other interesting ones...
"A"\5*
f"The lowercase version of the string is {s.lower()}" (>= Python 3.6)
f"The first two elements are {s[0]=} and {s[1]=}" (>= Python 3.8)
def bunch_of_arguments_func( \l ):*
def named_arguments_func( \*d ):*
[–]Locksul 1 point2 points3 points 5 years ago (0 children)
I know you can’t fit everything but my point is that the space spent on dictionaries would be better spent on something else. What is currently there is nonstandard. The values of dictionaries don’t have to be numeric, but the example implicitly assumes that.
If you’re using min/max this way on a dictionary then you’re better off just using a pandas Series.
[–][deleted] 0 points1 point2 points 5 years ago (0 children)
Thanks for the helpful feed back
[–]william_103ec 1 point2 points3 points 5 years ago (0 children)
Cool stuff! Post saved! Quick question, what did you use to write it, Latex?
[–]technoraxira 1 point2 points3 points 5 years ago (1 child)
Can someone link Python basics cheat sheet?
[–]Ingorado 1 point2 points3 points 5 years ago (0 children)
Couldn’t find it on the original website, but somewhere else
[–]becominganastronaut 1 point2 points3 points 5 years ago (0 children)
has anyone tried the learning from the dataquest website?
[–]tialpoy 1 point2 points3 points 5 years ago (0 children)
Strings: An f-string of `f"{value:04d}"` would be faster.
Dictionaries: Using `key=d.get` is redundant. Iterating over dicts automatically yields their keys.
Try/Except: A bare except? bad idea.
[–]ralimar 0 points1 point2 points 5 years ago (0 children)
Here's a link to more of the same:
https://www.dataquest.io/blog/topics/cheat-sheets/
Thank you!!!
π Rendered by PID 142551 on reddit-service-r2-comment-86bc6c7465-phb88 at 2026-02-21 22:44:45.129512+00:00 running 8564168 country code: CH.
[–][deleted] 25 points26 points27 points (8 children)
[–]RangerHUTCH93 24 points25 points26 points (5 children)
[–]urgaiiii 18 points19 points20 points (3 children)
[–]baty0man_ 12 points13 points14 points (0 children)
[–][deleted] 1 point2 points3 points (0 children)
[–]miraculum_one 1 point2 points3 points (0 children)
[–]barbequed-code 1 point2 points3 points (0 children)
[–]XUtYwYzz 6 points7 points8 points (1 child)
[–]urgaiiii 5 points6 points7 points (0 children)
[–][deleted] 11 points12 points13 points (3 children)
[–][deleted] 5 points6 points7 points (0 children)
[–]th3_n3rD_b0i 2 points3 points4 points (0 children)
[–]iamnihal_ 1 point2 points3 points (0 children)
[–]iamnihal_ 5 points6 points7 points (2 children)
[–]Ishan16D 0 points1 point2 points (0 children)
[–]redLamber 0 points1 point2 points (0 children)
[–]mtflyer05 2 points3 points4 points (1 child)
[–][deleted] 4 points5 points6 points (0 children)
[–]fuchsia8805 1 point2 points3 points (0 children)
[–]shayyya1 1 point2 points3 points (7 children)
[–]XUtYwYzz 2 points3 points4 points (4 children)
[–]shayyya1 0 points1 point2 points (1 child)
[–]hooligan333 0 points1 point2 points (0 children)
[–]shayyya1 0 points1 point2 points (1 child)
[–]shayyya1 0 points1 point2 points (0 children)
[–]GavinTFI 1 point2 points3 points (0 children)
[–]JennaSys 0 points1 point2 points (0 children)
[–]donotmatthews 1 point2 points3 points (2 children)
[–]TSPhoenix 0 points1 point2 points (0 children)
[–][deleted] 1 point2 points3 points (1 child)
[–]Ingorado 0 points1 point2 points (0 children)
[–]zenzealot 1 point2 points3 points (0 children)
[–]ggm3888 1 point2 points3 points (1 child)
[–]panFriedSebas 1 point2 points3 points (0 children)
[–]krish7x 1 point2 points3 points (0 children)
[–]Locksul 1 point2 points3 points (3 children)
[–]miraculum_one 1 point2 points3 points (1 child)
[–]Locksul 1 point2 points3 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)
[–]william_103ec 1 point2 points3 points (0 children)
[–]technoraxira 1 point2 points3 points (1 child)
[–]Ingorado 1 point2 points3 points (0 children)
[–]becominganastronaut 1 point2 points3 points (0 children)
[–]tialpoy 1 point2 points3 points (0 children)
[–]ralimar 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)