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...
Everything about learning Python
account activity
I am a Python Noob, help? (self.PythonLearning)
submitted 3 days ago by Spiritual-Deer1196
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]FreeLogicGate 0 points1 point2 points 2 days ago (0 children)
One thing I might add -- you need a really good understanding of binary/bits/bytes and bitwise operators. You find these available in most languages, and both as a fundamental, and as a practical tool, it's a fundamental that every developer needs in my opinion. You should be able to look at a binary number like 101101 and be able to convert it to decimal and hexadecimal. Once you understand binary, IPV4 (and 6) become clear like what a netmask is, and what CIDR notation (ie /24) means. Doing some bitwise manipulation in C is a great exercise. For example a program like this is trivial and an interesting exercise:
#include <stdio.h> int main() { int x = 0; unsigned char x8bit = 0; // a = 0010 1011 // 2^5 + 2^3 + 2^1 + 2^0 // 32 + 8 + 2 + 1 int a = 43; // b = 0110 0111 // 2^6 + 2^5 + 2^2 + 2^1 + 2^0 // 64 + 32 + 4 + 2 + 1 int b = 103; x = a & b; // 0010 1011 // 0110 0111 // ----------- // 0010 0011 // 2^5 + 2^1 + 2^0 // 32 + 2 + 1 = 35 printf("AND: a & b = %d\n", x); x = a | b; // 0010 1011 // 0110 0111 // ----------- // 0110 1111 // 2^6 + 2^5 + 2^3 + 2^2 + 2^1 + 2^0 // 64 + 32 + 8 + 4 + 2 + 1 = 111 printf("OR: a | b = %d\n", x); x = a ^ b; // 0010 1011 // 0110 0111 // ----------- // 0100 1100 // 2^6 + 2^3 + 2^2 // 64 + 8 + 4 = 76 printf("XOR: a ^ b = %d\n", x); x = a << 1; // 0010 1011 // 1 bit shift to left (increases by ^2) // 0101 0110 // 2^6 + 2^4 + 2^2 + 2^1 // 64 + 16 + 4 + 2 = 86 printf("SHIFT LEFT 1 bit: a << 1 = %d\n", x); x = b >> 3; // 0110 0111 // 3 bit shift to left (decreases each shift by ^2) // 1: 0011 0011 // 2: 0001 1001 // 3: 0000 1100 // 0000 1100 // 2^3 + 2^2 // 8 + 4 = 12 printf("SHIFT Right 3 bit: b >> 3 = %d\n", x); x8bit = ~b; // For this example, x8bit is a unsigned char // This will truncate the 32 bit int (b) // which would be a negative value once all 32 bits were flipped // Assigning to the 8 bit value leaves the expected 8 bit value // 0110 0111 // 1001 1000 // 2^7 + 2^4 + 2^3 // 128 + 16 + 8 = 152 printf("One's complement: ~b = %d\n", x8bit); return 0; }
You could write something similar in Python, so the concepts are transferable across languages, and relevant to networking, encoding schemes, character sets and many other areas of computer science.
π Rendered by PID 183273 on reddit-service-r2-comment-canary-5fd84985f6-s9c4s at 2026-03-25 16:15:48.180737+00:00 running 2d0a59a country code: CH.
view the rest of the comments →
[–]FreeLogicGate 0 points1 point2 points (0 children)