r/PythonLearning • • Sep 05 '26

Help Request Which one should I prefer mit or cs50p or mooc course

Post image
60 Upvotes

I want to go deep into it.


r/PythonLearning • • Jul 29 '26

Copying an object in different ways

Post image
60 Upvotes

An exercise to help build the right mental model for Python data. The “Solution” link uses memory_graph to visualize execution and reveals what’s actually happening:


r/PythonLearning • • Jun 16 '26

My Second Python Program 🥳 Greetings.py

Thumbnail
gallery
60 Upvotes

r/PythonLearning • • Apr 13 '26

Looking for a good platform to learn Python on!

60 Upvotes

I am looking for a good platform that I can learn Python on... Any suggestions would be much appreciated!


r/PythonLearning • • Mar 27 '26

Day 15: Built a Weather Journal — CSV, date filtering, and frequency analysis in one script

Thumbnail
gallery
60 Upvotes

Day 15. Three projects this week. Today: Weather Journal.

What it does:

  • Logs today's weather (city, temperature, condition) to a CSV

  • Checks if file exists before writing — adds header only on first run using os.path.isfile()

  • Filters last 7 days using dt.date.fromisoformat() to convert CSV strings back to date objects for comparison

  • Calculates weekly average temperature rounded to 2 decimal places

  • Finds most common weather condition using a frequency dictionary

Trickiest part: comparing dates. CSV always gives you strings. You can't do >= math on strings — had to convert with dt.date.fromisoformat(i[0]) before the comparison worked.

Output for Nagpur today: Mostly Sunny, 36.57°C weekly average.

Three complete projects this week — LifeOS, ExpenseOS, Weather Journal. All built from scratch, all postable. OOP starts Monday.


r/PythonLearning • • Sep 20 '25

Python is dynamically typed — what does that mean? (Beginner friendly explanation)

60 Upvotes

Dynamic nature of Python

When you started learning Python, you must have heard or read that Python is a dynamically typed language.
We don't need to specify the data types of our variables, Python figures it out during the runtime.
But have you ever wondered how it really works? Like how Python figures it out that:

x = 10 # This is an integer  
x = "This is a string"  

Let me try to explain as much as I can.

So the first and most important thing is: everything in Python is an object, and an object is nothing but an instance of a class.

Which means everything we use, whether it's integer, float, boolean, or string — every data type has its own class, and when we write:

x = 10

this actually means we are creating an object of the integer class which has a label x.


Difference between Python and C++

Let's try to understand this by differentiating it with C++.
So in C++:

int x = 10;

When we are creating a variable in C++, we use some memory block and provide a name (here x) to that memory block.
So if we say "x is storing 10" this will be a correct statement.

But in Python, when we declare our variable x and we say "x is storing 10," this is not correct at all.
But why? We are doing the same thing?

Because x is just a label to the object of the integer class.
This label can be transferred to any other object of any other class.
That is why in Python:

x = 10
x = "Hello"

✅ This will not throw any error.
❌ But if we do the same thing in C++ or Java, this is not allowed and we will get errors in our program.


Built-in classes

Let's understand these built-in classes one by one:

x = 10        # Integer
y = "hello"   # String
l = [1,2,3]   # List
  • 10 → instance of built-in class int

  • "hello" → instance of built-in class str

  • [1,2,3] → instance of built-in class list

So Python doesn’t use one "universal class" for all — each object is an instance of its specific built-in class, but all of them inherit from the base object class (this is an important statement).

It basically means that the object class is at the top of the hierarchy, and all the other classes are just its child or grandchild — which means they are inherited from it.


CPython - optional topic

Python is mostly implemented in C (the default implementation is called CPython).
Every object in Python is represented by a C structure called PyObject.
PyObject has a field called ob_type, which points to the type of the object (like int, str, etc.).

So when you create:

x = 10

CPython makes a PyLongObject (the C struct for integers).
It sets its type pointer (ob_type) to &PyLong_Type.
Then it adds a reference in the current namespace (locals() dictionary) with key "x" and value pointing to that object.

So under the hood:

  • Python keeps a dictionary of variable names → object references.

  • Objects know their type (class) via ob_type.

I know all of the above is a bit tough to understand, that's why I mentioned it as optional.

Feel free to correct me in the comments, I'm also learning and sharing my learnings here to revise it. Note: I used GPT to convert it into the markdown format and clear some grammar and spelling mistakes, all the explanation part has been done by me.


r/PythonLearning • • Aug 22 '25

Showcase 3D snake animation built in one python script (code shared)

60 Upvotes

r/PythonLearning • • Mar 06 '25

I made some Python memes for my upcoming book Python with Memes. What do you think?

Post image
60 Upvotes

r/PythonLearning • • Jan 20 '25

Best youtubers to learn python?

60 Upvotes

Hi, I'm sure this question gets asked a lot.

It has been a couple of years since I coded but I want to get back into it as I am heading to university and I know it will come up in some of my maths and economics modules especially Python and R. Plus it is just a useful skill to learn.

I prefer to learn from videos rather than reading. Is there any good youtubers out there that offer step by step tutorials of all basics in python plus intermediate level? Alternatively if there is any particularly good websites then I would be open to using them, I don't need a video, just prefer it.

Many thanks.


r/PythonLearning • • 8d ago

Showcase good start? started learning a week ago

59 Upvotes

r/PythonLearning • • 18d ago

Create PDF Reports Using Python with ReportLab!

Post image
59 Upvotes

Did you know you can generate professional PDF reports automatically using just a few lines of Python?

With the ReportLab library, you can create customized PDF documents containing titles, text, tables, charts, and much more.

What you can build:

✅ Automated data analysis reports

✅ Student performance reports

✅ Business and financial summaries

✅ Invoices and certificates

✅ Professional PDF documents


r/PythonLearning • • Sep 07 '26

Exercise: Python List Operations

Post image
59 Upvotes

An exercise to help build the right mental model for Python data.

The “Solution” link uses memory_graph to visualize execution and reveals what’s actually happening.


r/PythonLearning • • Jul 28 '26

Showcase 2nd week of python and wanted to try something new instead of course enjoyed it!

Post image
59 Upvotes

r/PythonLearning • • Jul 10 '26

Python, a question: what does underscore mean before a string in parentheses?

Post image
59 Upvotes

Python is gorgeous – logical! It took me but a few hours to figure out what this syntax could be :) Designating a string which has a translation at hand...

But I'd be grateful if someone explained it...

print(_("Something"))

Thanks in advance! :)

edit:

SORRY for the missing parenthesis in the picture :(
so typical of me..


r/PythonLearning • • Jun 10 '26

Showcase Day 4th Python learning

Thumbnail
gallery
59 Upvotes

Day 4th Python learning

- continue statement

Continue help to escape (skip I mean) anything in iteration you want to skip and then keep going on

-break statement

As name suggest it's use for end the iteration

-while statement

Same as name suggest while it's true , while will continue

Not like for which have end point before starting iteration

.

If I am wrong comment

#python #coding #ai


r/PythonLearning • • May 08 '26

Learning Python

Thumbnail
gallery
59 Upvotes

Good evening. Based on all the comments from the previous post, and taking into account all the suggestions, I have revised the code. I would like to hear from the experts what else can be done to make this code more competent, if necessary, as well as any other issues.

I wrote a program in which the user needs to enter the contents of two lists (numbers), and then these numbers are summed (the first number of the first list with the first number of the second list, and so on). If the list lengths are different, the summation of the smaller list starts with the first element)


r/PythonLearning • • Oct 10 '25

Showcase I am on day 3 of Angela Yu's 100 days of python and I am really liking it

Post image
59 Upvotes

r/PythonLearning • • Oct 07 '25

Help Request How do I remove this annoying line/divider?

Post image
59 Upvotes

Mind you I am fresh to programming as a whole... So don't get upset I don't know as much as you do.

Appreciate anyone taking their time to help!


r/PythonLearning • • Oct 05 '25

multiply_recursive

Post image
59 Upvotes

r/PythonLearning • • Sep 05 '25

Help Request Could anyone try to help me figure out how I'm supposed to solve this?

Post image
59 Upvotes

I assume it wants me to use for loops because that's what this unit was about. I have quite a bit of experience with python and programming in general but this just seems insane to me being at the almost very start of an introductory python course. I have genuinely no idea how I would do this so any help is greatly appreciated.


r/PythonLearning • • Mar 03 '25

Build Your Own Password Generator (Python)

59 Upvotes

r/PythonLearning • • Oct 03 '26

Giving back to the community - The Complete Backend Development Course

58 Upvotes

Hey everyone, I decided to make my course free in order to help people.
This course is my backend development course which is about SQL, Python, APIs, Docker, Kubernetes, Linux, Git & More

The link is: https://www.youtube.com/watch?v=CBIu6hcyStg

If you can like and subscribe (and maybe add a comment) I would appreciate it a lot, Thanks.


r/PythonLearning • • Jun 13 '26

Showcase Here's a fun project for beginners transitioning to intermediate: 2048

58 Upvotes

When I'm away from my desk (or in the bathroom), I code on my phone using online IDEs. Yeah, bite me. Anyways, here's a simple 2048 game and only under 200 lines (unoptimized)

Should be a straightforward yet challenging project for beginners using a lot of list/matrix logic and, in my case, recursion.


r/PythonLearning • • Jun 12 '26

Discussion Anyone willing to learn python with me?

58 Upvotes

Hello!
I'm Medansh, and I'm tryna learn some python since I really like computers. I would call myself somewhere between beginner and intermediate. I've made some projects, but I wouldn't call them more than a toy.
However, it's pretty lonely to learn it alone, and none of my IRL friends have any knowledge of computers. So I'm looking for some friends who might help each other along this journey!
I'd prefer if you are around my skill level (Knows syntax, has done a few projects, nothing too big), though if you're more of a beginner, it's still completely fine.

So, does anyone want to learn with me?

EDIT: I honestly didn’t expect this many responses 😅 I’ve already found a couple of people I’m going to work and learn with, so I’m keeping the group small. Thanks to everyone who reached out. It means a lot.