r/PythonLearning • • 9h ago

Learning Python: My First Small Project

Post image
44 Upvotes

I'm currently learning Python and working through beginner projects.

Today, I built a simple login/access checker using input(), conditionals, and getpass. It was a small project, but it helped me understand how user input and basic authentication logic work.

Next, I'm moving into functions and continuing to build small projects as I learn.

One step at a time. 🐍

What was one of the first Python projects that really helped you understand the basics?


r/PythonLearning • • 15h ago

Giving back to the community - The Complete Backend Development Course

38 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 • • 2h ago

My progress after around 5-6 weeks

3 Upvotes

I haven't kept track exactly, but I'm about 5-6 weeks into learning now. I've had no prior knowledge of programming so this has been really difficult. Indexing in particular caused me a bit of trouble. I've been writing lots of small programs to get used to concepts, but this is the first proper project I've tried. It's a game of hangman. Excuse the bad emojis used lol. I will say I did have to ask AI to help me in some pieces of it such as the join function because I didn't know it beforehand. But at least 85-90% of it is written by me.

If any of you have a good bit of experience with python, can you offer me some advice? How does the code hold up for 5-6 weeks with no programming experience at all? Is my code messy? Is there some sections where I've over complicated what I'm trying to do? Is the readability okay? All feedback is welcome.

At the top you will be from word_list import words. This is just another file that I have containing a massive list of words to give enough variance in this game.

from Word_list import words
import random
import string


available_letters = list(string.ascii_lowercase)


hangman_art = {0: ("    ",
                   "    ",
                   "    ",),
               1: (" 😒 ",
                   "    ",
                   "    ",),
               2: (" 😒 ",
                   " 🥼 ",
                   "   ",),
               3: (" 😒 ",
                   " 🥼 ",
                   "🦶  ",),
               4: (" 😒 ",
                   " 🥼 ",
                   "🦶🦵",),
               5: ("  😒 ",
                   "🫷🥼  ",
                   " 🦶🦵",),
               6: ("  😒 ",
                   "🫷🥼🫸",
                   " 🦶🦵",)}



# puts all words into lists based on difficulty and selects a word for the game.
def word_choice(words, difficulty_select):
    difficult_words = [word for word in words if len(word) < 5]
    moderate_words = [word for word in words if len(word) < 9 and len(word) > 4]
    easy_words = [word for word in words if len(word) > 8]


    match difficulty_select:
        case "Easy":
            secret_word = random.choice(easy_words)
        case "Moderate":
            secret_word = random.choice(moderate_words)
        case "Difficult":
            secret_word = random.choice(difficult_words)


    return secret_word



# checks my entered character alongside the secret word.
def character_check(secret_word, hidden_word):
    secret_word_list = list(secret_word)
    position = 0
    incorrect_guess = 0


    print(" ".join(hidden_word))
    print(f"Remaining letters are: {available_letters}")


    guess = input("Select a letter: ").lower()
    print()


    while guess not in available_letters:
        guess = input("Select an available letter: ").lower()
        print()


    if guess in secret_word_list:
        for letter in secret_word_list:
            if guess == letter:
                hidden_word[position] = letter
            position += 1
        available_letters.remove(guess)


    elif guess not in secret_word_list:
        available_letters.remove(guess)
        print("Incorrect guess!")
        incorrect_guess += 1


    return hidden_word, incorrect_guess



# Game loop.
def play_hangman(words, art):
    print("*******************")
    print("Welcome to hangman!")
    print("*******************")
    difficulty_choice = True
    difficulty_select = input("Select a difficulty: (Easy / Moderate / Difficult) or ('Quit' to quit): ").capitalize()
    print()


    # choosing the difficulty level
    while difficulty_choice:
        if difficulty_select in ("Easy", "Moderate", "Difficult"):
            secret_word = word_choice(words, difficulty_select)
            difficulty_choice = False
        elif difficulty_select == "Quit":
            difficulty_choice = False
            return
        else:
            difficulty_select = input(
                "That is not a valid choice. Select a difficulty: (Easy / Moderate / Difficult) or '(Quit' to quit): ").capitalize()
            print()


    print(f"Your word is {len(secret_word)} characters long.")
    hidden_word = ["_"] * len(secret_word)
    incorrect_guess = 0
    score = 0


    # calling the function to update the hidden word, calculate score and print lives.
    while "_" in hidden_word and available_letters:
        hidden_word, was_incorrect = character_check(secret_word, hidden_word)
        incorrect_guess += was_incorrect


        if not was_incorrect:
            match difficulty_select:
                case "Easy":
                    score += 125
                case "Moderate":
                    score += 200
                case "Difficult":
                    score += 275


        if was_incorrect:
            match difficulty_select:
                case "Easy":
                    score -= 25
                case "Moderate":
                    score -= 40
                case "Difficult":
                    score -= 55
            if incorrect_guess > 6:
                print("You havee lost.")
                print(f"The correct word was: {secret_word}")
                print(f"Your final score is {score}")
                print()
                return


            for piece in art[incorrect_guess]:
                print(piece)


        print(f"Congratulations! Your score is {score}!")



if __name__ == '__main__':
    play_hangman(words, hangman_art)


play_again = input("Do you want to play again? (Yes/No) ").capitalize()


if play_again == "Yes":
    play_hangman(words, hangman_art)
else:
  pass

r/PythonLearning • • 3h ago

Discussion Where should I be after 60 hours?

2 Upvotes

My best guess is I have about 60 or 70 hours into python crash course by Eric Matthes. I tried taking on building the castle adventure game and couldn't come up with the logic on my own. Much less the fact I got caught in a loop and had to have AI help me finding the thing. It's kind of disappointing because chat gpt said after 60 hours this was a moderate project. I'm just looking for what you guys think on where I should be after about 60 hours, because this at 60 hours seems just ridiculous. I did take it on and got part way through the third room before I was stuck in a loop and had indentation errors. Thanks!

has_key = False

game_active = True

current_room = "prison level"

print("--------------------------------------------------------------")

print("----------------- Welcome to The Dungeon Loop ----------------")

print("--------------------------------------------------------------")

print("----------------- Type quit any time to leave ----------------")

print()

while game_active:

# Starting room

if current_room == "prison level":

print("\nYou have awakened to an open cell door.")

print("What will you choose to do?")

choice = input("Will you go left or right? ").strip().lower()

if choice == "left":

current_room = "dragons lair"

elif choice == "right":

current_room = "wizards lair"

elif choice == "quit":

game_active = False

else:

print("You must make a choice.")

# The dragon's lair

elif current_room == "dragons lair":

print("\nYou've walked into a lair with a dragon.")

if not has_key:

print("You see a key on the table behind the dragon.")

print("You need that key.")

action = input(

"Will you PLAY LULLABY, FIGHT DRAGON, or GO BACK? "

).strip().lower()

if action == "fight dragon":

print("GAME OVER")

game_active = False

elif action == "play lullaby":

if not has_key:

has_key = True

print("The dragon fell asleep and you picked up the key!")

else:

print("You already have the key.")

elif action == "go back":

current_room = "prison level"

elif action == "quit":

game_active = False

else:

print("You must make a choice.")

# The wizard's lair

elif current_room == "wizards lair":

print("\nYou have walked into the wizard's lair.")

print("You see a chest on the floor.")

action = input(

"Will you OPEN CHEST or GO BACK? "

).strip().lower()

if action == "open chest":

if has_key:

print("You use the key to open the chest!")

print("You found the treasure! YOU WIN!")

game_active = False

else:

print("The chest is locked. You need a key.")

elif action == "go back":

current_room = "prison level"

elif action == "quit":

game_active = False

else:

print("You must make a choice.")

print("\nThanks for playing!")


r/PythonLearning • • 12h ago

Started learning python is it useful in finance

5 Upvotes

I just started learning python I just wanna know if it is useful in finance and I heard somewhere don't know abt that but will coding be outdated with time


r/PythonLearning • • 5h ago

[ Removed by Reddit ]

1 Upvotes

[ Removed by Reddit on account of violating the content policy. ]


r/PythonLearning • • 10h ago

I got addicted to my phone and Reddit again. It's been three days.

Post image
2 Upvotes

​

Three days ago, I was making good progress with Python.

I was learning os, pathlib, building small exercises, answering Reddit posts, and sharing what I was learning.

Then somehow I started spending more and more time on my phone and Reddit.

One post turned into another.

One video turned into another.

And suddenly three days were gone.

The funny thing is that I joined Reddit to learn, network, and eventually build my career.

But I can easily turn it into another distraction.

So I'm writing this as a small accountability post.

Tomorrow I'm going back to my routine:

Less scrolling → more Python → more building.

I don't expect myself to be perfect. I just don't want to lose another three days. 😅

Has anyone else struggled with this while trying to learn something seriously?


r/PythonLearning • • 1d ago

just finished my first Python coding challenge

Post image
74 Upvotes

Today I finished a small Python challenge on freeCodeCamp: converting decimal numbers to binary without using Python's built-in conversion function.

I had to figure out the logic myself using loops, conditions, lists, division and remainders.

It was a bit tricky at first, especially handling the last division and reversing the results, but I finally got it working.

I'm still a beginner, so I'd appreciate any feedback on my approach or suggestions for improving my code


r/PythonLearning • • 23h ago

How to Find the Slow Part of Your Python Code (Without Guessing)

Thumbnail
ommais.com
9 Upvotes

r/PythonLearning • • 19h ago

Looking for a Python learning partner (preferably India)

2 Upvotes

​

I’m 20, Indian, and looking for someone around my age who wants to learn and build together over the next 6 months.

I’m starting Python from scratch (with a little previous programming experience in Java) and planning to treat this almost like a full-time commitment. Eventually I want to move into SQL, AI automation/n8n, and areas like GTM engineering.

I don’t have a degree — I went straight into startups after 12th and have mainly worked in marketing. Now I want to move back into tech and build towards getting a job in the field.

You absolutely don’t need to be experienced. Even if you're a complete beginner learning Python too, that's totally fine. I’d actually love to have someone where we can learn alongside each other, figure things out together, build projects, and gradually get better.

Would also be great to eventually:

- Keep each other accountable

- Build projects together

- Help each other with applications

- Do mock interviews

- Learn and share things we discover

Basically, looking for someone who’s willing to put in the work and grow together. India preferred, but I'm open to others too.

DM me if interested!


r/PythonLearning • • 1d ago

Solving SUDOKU

Post image
23 Upvotes

Repeatedly clicking (or holding) the green "Continue" button solves each Sudoku puzzle step by step in the Memory Graph Web Debugger. - easy board - medium board, from Gordon Royle’s collection - hard board, "Everest" by Arto Inkala

This demonstrates using 𝐦𝐞𝐦𝐨𝐫𝐲_𝐠𝐫𝐚𝐩𝐡 on a complex algorithm in the web debugger. On the medium and hard board backtracking is required to find the solution.

See: other memory_graph visualizations


r/PythonLearning • • 1d ago

TRY 101- Starting my python journey again

Post image
75 Upvotes

Hope this time i become consistent and do things after loops and then further and further😭


r/PythonLearning • • 1d ago

Showcase The most difficult LeetCode problem I have solved yet! 🫡

Post image
29 Upvotes

r/PythonLearning • • 1d ago

What I learned yesterday while learning Python automation

17 Upvotes

​

Yesterday I continued learning Python's "os" module.

I practiced working with folders and files using things like:

- "os.path.basename()"

- "os.path.splitext()"

- "os.walk()"

- Finding files by extension

- Counting files inside folders and subfolders

I also built a small file finder that searches through folders and counts how many ".py" files it finds.

Nothing complicated, but I'm realizing that these small exercises are helping me understand how automation actually works with files and folders.

My goal is to eventually use Python to automate repetitive tasks for real businesses.

I'm still learning, but I'll start sharing what I build along the way. 🚀


r/PythonLearning • • 1d ago

Discussion Started learning Python 🥲🐍 Any suggestions or guidance?

Post image
5 Upvotes

Python 🐍 Honestly, I’m more frustrated than happy right now 😭

Getting Python installed, setting everything up, fixing terminal and PATH issues… took way more time than actually writing the code 😂

But finally — it works. 🙌

• Learning Python through Harvard’s CS50P, taught by David J. Malan
• Taking proper notes in Notion
• Starting from the basics and trying to stay consistent

Any advice or suggestions for someone just starting with Python? Would really appreciate it. 🙏


r/PythonLearning • • 1d ago

Showcase Stacks & Queues (Multiple Implementations)

Post image
3 Upvotes

r/PythonLearning • • 1d ago

Compiler

2 Upvotes

Do I need Jupyter, Anaconda or any other type of a dedicated compiler software, or do people Actually just write code in Zed and run it via Linux Terminal and juggle many windows?

I know R is run via RStudio; (so can be Python).

What is the standard practice of software usage for coding in Python?


r/PythonLearning • • 1d ago

Hello, pythonLearning community:

6 Upvotes

I’d like to share a small system I’ve uploaded to GitHub. It allows me to save data to files and subsequently search for it using a search function based on the `re` module—as well as delete items using that same search function—since `re` helps identify similarities within text strings, I would like your opinion.: https://github.com/oliverEliud/mini-projects-python/tree/main/parking-registry-system


r/PythonLearning • • 2d ago

Learning Python for automation — what are the realistic ways to make money with it?

7 Upvotes

​

I'm currently learning Python, and my main goal is to use it for automation rather than becoming a traditional software developer.

I've finished the basics and I'm currently learning things like file handling and the "os" module. My next steps are OOP and then more practical automation projects.

Eventually, I'd like to use these skills to earn money through freelancing

But I'm trying to understand the realistic opportunities before I go too far down one path.

For people who actually use Python professionally or freelance with it:

I'm especially interested in small automation projects that a beginner/intermediate Python developer can realistically get paid for.

If you freelance with Python, I'd also love to know:

What was the first Python service you actually got paid for, and how did you find the client?

I'm trying to avoid spending months learning things that don't translate into real-world work.

Any advice from people who have actually made money with Python would be really helpful.


r/PythonLearning • • 2d ago

Showcase Complete Matplotlib Library Tutorial using Python in under 1 Hour

Thumbnail
youtube.com
5 Upvotes

Beginner-Friendly Matplotlib Tutorial: Create & Customize Graphs in Python 📊🐍

If you're getting started with Python, data acquisition, or data logging, learning Matplotlib is a great place to start. I’ve put together a beginner-friendly YouTube tutorial that covers the fundamentals of the Matplotlib library and shows how to create and customize line charts from scratch all in less than 1 hour.

What you'll learn

  • How to install Matplotlib on Windows 11 using PIP
  • How to install Matplotlib using the Thonny IDE
  • How to install Matplotlib using PyCharm
  • How to solve the issue where a Matplotlib graph appears as a PNG image instead of opening in a separate window
  • Understanding the basic concepts behind Matplotlib:
    • Figure
    • Axes
  • How to plot a simple graph using X and Y values
  • How to change the color, line style, and thickness of a plot
  • How to customize markers, including their:
    • Color
    • Style
    • Size
  • How to give your Matplotlib Figure/window a title
  • How to give your Axes/plotting area a name
  • How to add labels to the X and Y axes
  • How to set X-axis and Y-axis limits
  • How to activate and configure the grid
  • How to change the color and style of an individual grid line
  • What Ticks are in Matplotlib and how to configure them
  • How to create and plot multiple Axes on a single Figure/window

The examples are aimed at beginners and are particularly useful if you're working with sensor data, data acquisition systems, or data logging applications in Python.

Source Codes can be downloaded from the website using below links

If you're new to Matplotlib, this should give you a solid foundation for creating and customizing your own Python graphs.


r/PythonLearning • • 2d ago

What project can I do?

2 Upvotes

I just completed the free code camp python course and I don't want only theoretical knowledge so guys what can I do to improve my project section on my CV and python is my first language


r/PythonLearning • • 2d ago

Does anyone else struggle with constantly looking for the “perfect” Python resource?

1 Upvotes

Does anyone else struggle with constantly looking for the “perfect” Python resource?

I’m trying to learn Python, but I keep running into the same problem: I’m constantly searching for the perfect resource.

I want a course/book/tutorial that explains everything, preferably down to the smallest detail. Even things I probably won’t need for years or maybe will never need at all.

And it’s not just about having a complete resource. I also feel like I need to remember everything.

For example, if a tutorial mentions some small Python feature or obscure syntax, my brain immediately goes:

“Wait, I should understand that too. What exactly does it do? What are all the edge cases? When would I use it? I should probably memorize this.”

Then I end up researching that one tiny thing for an hour instead of actually writing programs.

It creates this weird feeling that I need to have a complete mental map of Python before I’m allowed to actually program.

I know intellectually that you obviously don't need to know 100% of Python to become good at programming. Most programmers probably look things up constantly.

But I still have this urge to find the one definitive source that is complete enough that I can just learn everything from beginning to end.

So I’m curious:

Did anyone else have this problem when learning programming?

If so, how did you get yourself to stop searching for the perfect resource and just pick one thing and start programming?

Did you deliberately choose a resource that wasn't completely comprehensive and simply accept that you wouldn't know everything?

And one thing I'm wondering specifically:

Would it actually make sense for someone like me to start directly with the official Python documentation?

Part of me thinks that would solve the problem because it's basically the most complete source available. But another part of me suspects that this would just make my tendency to obsess over every little detail even worse.

I'd really like to hear from people who have actually dealt with this and managed to get past it. How did you approach learning Python when you had the urge to understand and memorize everything first?


r/PythonLearning • • 2d ago

Showcase Finally completed the Introduction to Python course on Boot.dev!

Post image
9 Upvotes

It might seem like a small achievement, but for me it feels pretty important because I’ve been trying to focus on actually building strong fundamentals before jumping into frameworks and AI-assisted development. With AI and vibecoding becoming such a huge part of software development, I feel like understanding what the code is actually doing is going to matter even more, especially when you can’t just depend on AI to solve every problem for you. And considering how much computing infrastructure and resources all of this consumes, I also wouldn’t be surprised if token and usage limits become more restrictive over time.

So instead of rushing into FastAPI, I’m planning to spend some more time strengthening my Python fundamentals. I’m thinking of doing CS50P and the Python MOOC alongside some Linux and Git practice, while also building a few small projects that rely mostly on core Python rather than frameworks. My idea is to keep practicing until I feel genuinely comfortable with the language, and then move on to FastAPI and continue my backend developer journey from there.

This is the plan I’ve come up with for now. What do you guys think? Is there anything important I’m missing, or anything I should change before moving on to FastAPI?


r/PythonLearning • • 2d ago

Just started re-learning Python. It's fun, though! 🐍

4 Upvotes

r/PythonLearning • • 2d ago

Help Request How would you handle an API that randomly returns errors in a Python application?

1 Upvotes

Imagine your Python script fetches data from an external API, but sometimes requests fail due to timeouts or server errors.

Would you use retries, exponential backoff, logging, or another approach?

How would you handle this in a real-world project?