r/learnpython • • 28m ago

Can't run matplotlib

0 Upvotes

I'm trying to make a graph using data points using matplotlib but for some reason, it's not working. I installed it using python -m pip install matplotlib and got a whole block of text with all the lines starting with, Requirement already satisfied. But, when I try to run, import matplotlib.pyplot as plt in my code, I get an error saying ModuleNotFoundError: No module named 'matplotlib'

Anyone know what the issue is and how I can get it resolved?


r/learnpython • • 1h ago

Python 3.10.11 Ribbon Bar

0 Upvotes

I am new to Python and I have been looking around the web for a working ribbon bar like Microsoft Office. Does anyone have anything that they use? I have my toolbar and splash screen all created. I have to use this version of Python so that my toolbar works otherwise I would be on the latest and greatest version. Thanks in advance.


r/learnpython • • 5h ago

Looking for a learning partner

0 Upvotes

Hi... I'm just the beginner in Python language. Although I'm practicing my own lessons through ChatGpt and by the help of other social groups but I'm thinking it would better if I could get a partner with same intention/interest.


r/learnpython • • 8h ago

I cannot figure this out for thie life of me.

0 Upvotes

I am trying to plot a graph using values in a dictionary. I know it doesn't need to be in a dictionary but I'm not smart enough to figure out how to modfy the plotting code to work on anything else.
This is the code used to produce the values.

matrix=np.array(np.stack(matrix,axis=0))

eigenvalues, eigenvectors = np.linalg.eig(matrix)

eigenvectors=np.transpose(eigenvectors)

eigens = dict(zip(eigenvalues, eigenvectors))

eigens = dict(sorted(eigens.items()))

It is calculating the eigen values and vectors of a 2d array. I am trying to isolate the values labeld as eigenvalues into a dictionary or maybe two lists. But I need the key to be a rounded string that can be paired with unicode and the value to be a a float which I can then multiply by -1.

I have been at this for 3 days I cannot figure this out.


r/learnpython • • 9h ago

doing beginner project of wordle type game as beginner. Any tips?

3 Upvotes

Any tips? and what projects should I try after this to learn more about python.

Learned about ANSI color and more about list doing it. It was fun. Any improvements?

import random
from  words_list import WORDS  
# Importing the list of words from worlde_list.py


# ANSI color codes 
GREEN = "\033[42m\033[30m"   
# Green background, black text
YELLOW = "\033[43m\033[30m"  
# Yellow background, black text
GRAY = "\033[100m\033[37m"   
# Gray background, white text
RESET = "\033[0m"


def play():


    random_word = random.choice(WORDS)  
# Randomly selects a word from the list
    attempts = 6  
# Incorrect attempts remaining


    print("Welcome to Worlde! You have 6 attempts to guess the word.")


    while attempts > 0:


        print(f"You have {attempts} attempts remaining.")
        guess = input("Enter a word: ").upper()  
# Player inputs a guess, converted to uppercase


        if not guess.isalpha():
            print("Please enter alphabets. Numbers and symbols aren't allowed.")
            continue
        elif len(guess) != len(random_word):
            print(f"Please enter a word which has {len(random_word)} letters.")
            continue


        letter_count = {}


        for letter in random_word:
            if letter in letter_count:
                letter_count[letter] += 1
            else:
                letter_count[letter] = 1


        
# Create an empty list to store the feedback
        feedback = [""] * len(guess)


        
#Check for green letters 
        for i in range(len(guess)):
            if guess[i] == random_word[i]:
                feedback[i] = GREEN + guess[i] + RESET
                letter_count[guess[i]] -= 1
                continue


        
#For both yellow and green letters, we need to check the remaining letters in the random word
        for i in range(len(guess)):
            if guess[i] == random_word[i]:
                continue  
# Skip already matched letters
            elif guess[i] in letter_count and letter_count[guess[i]] > 0: 
## Checks if the letter exists in the word and has any unused occurrences remaining.
                feedback[i] = YELLOW + guess[i] + RESET
                letter_count[guess[i]] -= 1
            else:
                feedback[i] = GRAY + guess[i] + RESET


        attempts -= 1


        print("".join(feedback))  
# Displays the feedback for the guessed word
        if guess == random_word:
            print("Congratulations! You've guessed the word correctly.")
            break


    if attempts == 0 and guess != random_word:
        print(f"Sorry, you've run out of attempts. The correct word was: {random_word}")




play()

r/learnpython • • 10h ago

Django Meta class

2 Upvotes

can anyone explain about djang meta inner class ? I am confusing about it.


r/learnpython • • 10h ago

I built my own custom programming language interpreter in Python! Looking for feedback and roast.

0 Upvotes

Hey everyone!

I'm still learning, and as a fun side project, I wrote a simple interpreter for my own custom language in Python.

Every command starts with C and uses parentheses with ; as a separator (e.g., Cp(x;10) to assign a variable, Ctor(x;+;*5;y) for math, Cgate(arr) for lists, and Cjump(label) with u/2label2@ for gotos). It also supports basic Cif conditions, user input via Cwhy?(var), random numbers, and string slicing.

Here is the full code of my interpreter:

    import random
    def prin(e):
        print(e, end='')

    def g(x):
        return x[1]

    def p_gate(a, b, c):
        w='Cgate('
        k=a.find(w, b)+len(w)
        kend=a.find(')',k)
        all=a[k:kend]
        c[all]=[]
        return kend

    def p_re(a, b, c):
        w='Cre('
        k=a.find(w, b)+len(w)
        kend=a.find(')',k)
        all=a[k:kend]
        now = all.split(';')
        c[now[0]][int(c[now[1]])]=c[now[2]]
        return kend

    def p_ro(a, b, c):
        w='Cro('
        k=a.find(w, b)+len(w)
        kend=a.find(')',k)
        all=a[k:kend]
        now = all.split(';')
        c[now[0]].append(c[now[1]])
        return kend

    def p_ra(a, b, c):
        w='Cra('
        k=a.find(w, b)+len(w)
        kend=a.find(')',k)
        all=a[k:kend]
        now = all.split(';')
        c[now[0]]=c[now[1]][int(c[now[2]])]
        return kend

    def p_text(a, b, c):
        w='Ctext('
        k=a.find(w, b)+len(w)
        kend=a.find(')',k)
        all=a[k:kend]
        if all[0]=='*':
            prin(all[1:])
        else:
            prin(c[all])
        return kend

    def p_sub(a, b, c):
        w = 'Csub('
        k = a.find(w, b) + len(w)
        kend = a.find(')', k)
        now = a[k:kend].split(';')
        src = c[now[0]]
        start = int(now[1][1:]) if now[1].startswith('*') else int(c[now[1]])
        count = int(now[2][1:]) if now[2].startswith('*') else int(c[now[2]])
        c[now[3]] = src[start : start + count]
        return kend

    def p_jump(a, b, c):
        w='Cjump('
        k=a.find(w, b)+len(w)
        kend=a.find(')',k)
        all=a[k:kend]
        return a.find('@2'+all+'2@')

    def p_why(a, b, c):
        w='Cwhy?('
        k=a.find(w, b)+len(w)
        kend=a.find(')',k)
        all=a[k:kend]
        c[all]=input()
        return kend

    def p_rnd(a, b, c):
        w='Crnd('
        k=a.find(w, b)+len(w)
        kend=a.find(')',k)
        all=a[k:kend]
        now=all.split(";")
        c[now[0]]=random.randint(int(now[1]),int(now[2]))
        return kend

    def p_str(a, b, c):
        w='Cstr('
        k=a.find(w, b)+len(w)
        kend=a.find(')',k)
        all=a[k:kend]
        now=all.split(';')
        for x in range(len(now)):
            c[now[x]]=str(c[now[x]])
        return kend

    def p_num(a, b, c):
        w='Cnum('
        k=a.find(w, b)+len(w)
        kend=a.find(')',k)
        all=a[k:kend]
        now=all.split(';')
        for x in range(len(now)):
            c[now[x]]=float(c[now[x]])
        return kend

    def p_if(a, b, c):
        w='Cif('
        k=a.find(w, b)+len(w)
        kend=a.find(')',k)
        all=a[k:kend]
        now=all.split(';')
        op2=float(now[2][1:]) if now[2].startswith("*",0) else c[now[2]]
        op1=float(now[0][1:]) if now[0].startswith("*",0) else c[now[0]]
        if g(now)=='eq':
            res=op1==op2
        elif g(now)=='nq':
            res=op1!=op2
        elif g(now)=='bg':
            res=op1>op2
        elif g(now)=='sm':
            res=op1<op2
        return (kend, res)

    def p_tor(a, b, c):
        w='Ctor('
        k=a.find(w, b)+len(w)
        kend=a.find(')',k)
        all=a[k:kend]
        now=all.split(';')
        op2=float(now[2][1:]) if now[2].startswith("*",0) else c[now[2]]
        op1=float(now[0][1:]) if now[0].startswith("*",0) else c[now[0]]
        if g(now)=='+':
            res=op1+op2
        elif g(now)=='-':
            res=op1-op2
        elif g(now)=='/':
            res=op1/op2
        elif g(now)=='*':
            res=op1*op2
        c[now[3]]=res
        return kend

    def p_p(a,b,c):
        w='Cp('
        k=a.find(w, b)+len(w)
        kend=a.find(')',k)
        all=a[k:kend]
        s=all.split(';')
        c[s[0]]=s[1]
        return kend

    def main(a):
        b=0
        c={}
        yes=1
        while b<len(a):
            if yes==1:
                if a.startswith('Ctext(', b):
                    b=p_text(a,b,c)
                elif a.startswith('Cre(', b):
                    b=p_re(a,b,c)
                elif a.startswith('Cgate(', b):
                    b=p_gate(a,b,c)
                elif a.startswith('Cra(', b):
                    b=p_ra(a,b,c)
                elif a.startswith('Cro(', b):
                    b=p_ro(a,b,c)
                elif a.startswith('Cjump(', b):
                    b=p_jump(a,b,c)
                elif a.startswith('Cp(', b):
                    b=p_p(a,b,c)
                elif a.startswith('Csub(', b):
                    b=p_sub(a,b,c)
                elif a.startswith('Ctor(', b):
                    b=p_tor(a,b,c)
                elif a.startswith('Cnum(', b):
                    b=p_num(a,b,c)
                elif a.startswith('Cstr(', b):
                    b=p_str(a,b,c)
                elif a.startswith('Cif(', b):
                    b, yes=p_if(a,b,c)
                elif a.startswith('Cwhy?(', b):
                    b=p_why(a,b,c)
                elif a.startswith('Crnd(', b):
                    b=p_rnd(a,b,c)
                else:
                    n=a.find("C",b)
                    if n!=-1:
                        b=n
                    else:
                        b+=1
            else:
                b=a.find("endif",b)
                yes=1
        print('[program finished]\n')

    if __name__=='__main__':
        main(input('>'))

I know the parser is pretty basic (it just moves an index through the string) and there's a lot to improve, so I'd love to hear your thoughts! What features should I add next, and how can I make the Python code cleaner?

Sorry for any mistakes, English isn't my first language!


r/learnpython • • 11h ago

im wrote lacenta interpreter

0 Upvotes

hi all, im the begginner in python, so, im wroted my first interpretator. im dont wroted docs for this. please please dont kill me.

import random


def prin(e):
    print(e, end='')


def g(x):
    return x[1]


def p_gate(a, b, c):
    w = 'Cgate('
    k = a.find(w, b) + len(w)
    kend = a.find(')', k)
    all = a[k:kend]
    c[all] = []
    return kend


def p_re(a, b, c):
    w = 'Cre('
    k = a.find(w, b) + len(w)
    kend = a.find(')', k)
    all = a[k:kend]
    now = all.split(';')
    c[now[0]][int(c[now[1]])] = c[now[2]]
    return kend


def p_ro(a, b, c):
    w = 'Cro('
    k = a.find(w, b) + len(w)
    kend = a.find(')', k)
    all = a[k:kend]
    now = all.split(';')
    c[now[0]].append(c[now[1]])
    return kend


def p_ra(a, b, c):
    w = 'Cra('
    k = a.find(w, b) + len(w)
    kend = a.find(')', k)
    all = a[k:kend]
    now = all.split(';')
    c[now[0]] = c[now[1]][int(c[now[2]])]
    return kend


def p_text(a, b, c):
    w = 'Ctext('
    k = a.find(w, b) + len(w)
    kend = a.find(')', k)
    all = a[k:kend]
    if all[0] == '*':
        prin(all[1:])
    else:
        prin(c[all])
    return kend


def p_sub(a, b, c):
    w = 'Csub('
    k = a.find(w, b) + len(w)
    kend = a.find(')', k)
    now = a[k:kend].split(';')
    src = c[now[0]]
    start = int(now[1][1:]) if now[1].startswith('*') else int(c[now[1]])
    count = int(now[2][1:]) if now[2].startswith('*') else int(c[now[2]])
    c[now[3]] = src[start:start + count]
    return kend


def p_jump(a, b, c):
    w = 'Cjump('
    k = a.find(w, b) + len(w)
    kend = a.find(')', k)
    all = a[k:kend]
    return a.find('@2' + all + '2@')


def p_why(a, b, c):
    w = 'Cwhy?('
    k = a.find(w, b) + len(w)
    kend = a.find(')', k)
    all = a[k:kend]
    c[all] = input()
    return kend


def p_rnd(a, b, c):
    w = 'Crnd('
    k = a.find(w, b) + len(w)
    kend = a.find(')', k)
    all = a[k:kend]
    now = all.split(";")
    c[now[0]] = random.randint(int(now[1]), int(now[2]))
    return kend


def p_str(a, b, c):
    w = 'Cstr('
    k = a.find(w, b) + len(w)
    kend = a.find(')', k)
    all = a[k:kend]
    now = all.split(';')
    for x in range(len(now)):
        c[now[x]] = str(c[now[x]])
    return kend


def p_num(a, b, c):
    w = 'Cnum('
    k = a.find(w, b) + len(w)
    kend = a.find(')', k)
    all = a[k:kend]
    now = all.split(';')
    for x in range(len(now)):
        c[now[x]] = float(c[now[x]])
    return kend


def p_if(a, b, c):
    w = 'Cif('
    k = a.find(w, b) + len(w)
    kend = a.find(')', k)
    all = a[k:kend]
    now = all.split(';')
    op2 = float(now[2][1:]) if now[2].startswith("*", 0) else c[now[2]]
    op1 = float(now[0][1:]) if now[0].startswith("*", 0) else c[now[0]]
    if g(now) == 'eq':
        res = op1 == op2
    elif g(now) == 'nq':
        res = op1 != op2
    elif g(now) == 'bg':
        res = op1 > op2
    elif g(now) == 'sm':
        res = op1 < op2
    return (kend, res)


def p_tor(a, b, c):
    w = 'Ctor('
    k = a.find(w, b) + len(w)
    kend = a.find(')', k)
    all = a[k:kend]
    now = all.split(';')
    op2 = float(now[2][1:]) if now[2].startswith("*", 0) else c[now[2]]
    op1 = float(now[0][1:]) if now[0].startswith("*", 0) else c[now[0]]
    if g(now) == '+':
        res = op1 + op2
    elif g(now) == '-':
        res = op1 - op2
    elif g(now) == '/':
        res = op1 / op2
    elif g(now) == '*':
        res = op1 * op2
    c[now[3]] = res
    return kend


def p_p(a, b, c):
    w = 'Cp('
    k = a.find(w, b) + len(w)
    kend = a.find(')', k)
    all = a[k:kend]
    s = all.split(';')
    c[s[0]] = s[1]
    return kend


def main(a):
    b = 0
    c = {}
    yes = 1
    while b < len(a):
        if yes == 1:
            if a.startswith('Ctext(', b):
                b = p_text(a, b, c)
            elif a.startswith('Cre(', b):
                b = p_re(a, b, c)
            elif a.startswith('Cgate(', b):
                b = p_gate(a, b, c)
            elif a.startswith('Cra(', b):
                b = p_ra(a, b, c)
            elif a.startswith('Cro(', b):
                b = p_ro(a, b, c)
            elif a.startswith('Cjump(', b):
                b = p_jump(a, b, c)
            elif a.startswith('Cp(', b):
                b = p_p(a, b, c)
            elif a.startswith('Csub(', b):
                b = p_sub(a, b, c)
            elif a.startswith('Ctor(', b):
                b = p_tor(a, b, c)
            elif a.startswith('Cnum(', b):
                b = p_num(a, b, c)
            elif a.startswith('Cstr(', b):
                b = p_str(a, b, c)
            elif a.startswith('Cif(', b):
                b, yes = p_if(a, b, c)
            elif a.startswith('Cwhy?(', b):
                b = p_why(a, b, c)
            elif a.startswith('Crnd(', b):
                b = p_rnd(a, b, c)
            else:
                n = a.find("C", b)
                if n != -1:
                    b = n
                else:
                    b += 1
        else:
            b = a.find("endif", b)
            yes = 1
    print('[program finished]\n')


if __name__ == '__main__':
    main(input('>'))

thats an a repost my first mesg, where formatting go vroom


r/learnpython • • 11h ago

Beginner python study group?

10 Upvotes

Absolute newbie here. Im lookjng for a small group of people to learn python with. (i hope im not breaking any rules)


r/learnpython • • 12h ago

Looking for feedback on my Polymarket BTC 15-minute Up/Down bot strategy

0 Upvotes

Hi everyone,

I'm building a Python bot for Polymarket's BTC 15-minute Up/Down markets. It's still in paper mode (no real money yet).

What it does now:

- Logs every trade, the order book depth and spread, the Kraken BTC price, and the market resolution

- Follows a few profitable wallets and only enters when they agree

- Has a daily loss limit and pauses after a losing streak

What I learned so far:

- I can't compete on speed with the fast maker bots, so I stopped trying

- Taker orders tested better than maker orders for me

My questions:

  1. Is there still a real edge in 15-minute BTC markets for a slow bot, or is it mostly fees and noise?
  2. What would you test first: entry price filters, time of day, or adding ETH/SOL markets?
  3. Any common mistakes to avoid before going live?

Thanks for any advice.


r/learnpython • • 15h ago

Best courses to learn Python and MATLAB for NVH data analysis?

5 Upvotes

I want to learn Python and MATLAB for NVH data analysis. Can anyone recommend good courses for beginners?

I want to learn practical applications like FFT, vibration analysis, SPL, STL, frequency analysis, and processing NVH test data.

Which should I learn first, Python or MATLAB? Also, please suggest courses that are useful for automotive NVH jobs.


r/learnpython • • 18h ago

Which python should I start with?

3 Upvotes

Data Analysis with python OR Legacy python for everyone. This is on codeacademy, if you have another recommendation I'm all ears. I'm gonna download some apps that are primarily python focused but I am mainly just asking on behalf of where to start on codeacademy.


r/learnpython • • 18h ago

Is this a good game to learn?

1 Upvotes

Hi, good evening,

my brother and I would like to learn how to program, (me Python, he dart and flutter, ) my brother already used to know HTML CSS and Javascript. Some years ago.

I wanted to know if Kingdom.py from Steam is it a good one for me to learn Python as a total beginner? Or is Codecombat better?

I like the fact that kindgom.py is a one time pay. But I dont know if all code relating things are accurate and well debugged. In contrast to the joy of programming, (from which I read some bad reviews, despite its many good ones) (oh, and I also know that Joy of Programming is for more advanced learners)

And should I or my brother also play the farmer was replaced or Human resource Machine? What would you recommend us? And thanks in advance 🙇🏻🍀☀️

Btw. I'm planning to complete the CS50P in the future. (I'm following some Spanish speaking free courses first [Mouredev -on youtube] in order to have a better grasp of abstract/logical concepts in my native language before encountering them in English) (And will probably do the CS50X Spanish dubbed later on) But I dont know if it's also necessary for Python. 🥹

I'm open to any recommendation and would appreciate your knowledge about it. Thanks, and have a good night


r/learnpython • • 23h ago

Has anyone been able to join the MOOC.fi discord?

2 Upvotes

I've been self teaching using their lessons for about a week now, but without access to their server I can't check answers for exercises I'm stumped on. Their pastebin method doesn't work as it requires a verified account, and none of their confirmation emails send.


r/learnpython • • 1d ago

Beginner in Python

11 Upvotes

Hello guys, im currently in 10th grade and im 15, im considering being an IT as my professional career, so i figured i should learn Python to get started with, im not really aiming to master Python within a time period or something, but rather than i want to learn basic knowledge about it so if ever being an IT is my final decision for my career, Im a total beginner in Python and tech in general, my only big project was switching to linux, What is the best way to get started with??


r/learnpython • • 1d ago

Cyber security

6 Upvotes

I am 19 year 1st year btech student and in my vacation I want to learn about ethical hacking and cyber security so where to start as there are too many courses which are too expensive and can anyone guide from where to start and what is journey if you know can you recommened me. Books also which I can study


r/learnpython • • 1d ago

Brainstorming for Python project about optimization for gaming

3 Upvotes

Building a Python-based Windows maintenance and gaming optimization application — looking for community feedback and ideas!
I currently work in IT at an MSP and am pursuing my bachelor’s degree in Information Technology. I’ve been brainstorming a personal project to improve my Python, PowerShell, automation, and software development skills.
The idea originally came from all the repetitive things I do before getting on Call of Duty. I figured I could automate those tasks, create a customizable application, and turn it into a professional portfolio project.
I’m still in the planning phase, but here are some features I’m considering:
System Maintenance & Updates
Windows and security update checks
Automatic CPU, GPU, and hardware identification
Hardware-specific driver update checks
Microsoft Store application updates
Desktop application updates
Temporary file cleanup
DirectX and game-specific shader cache management
Storage and system health diagnostics
Gaming & Performance Optimization
Normal, Gaming, and Maximum Performance profiles
Customizable background process and service management
Individual toggles for applications and services
Automatic secondary monitor management
CPU, GPU, RAM, and VRAM monitoring
Network latency and bandwidth monitoring
Automatic game and launcher startup
Automatic restoration of system settings after gaming
Power & Battery Management
Automatic desktop and laptop detection
Battery and charging status detection
Selectable efficiency, balanced, and performance modes
Optional automatic power management
Temperature monitoring
User-configurable power preferences
Security & Safety
Download drivers directly from approved manufacturers
Verify installer digital signatures and publishers
Verify hardware and operating system compatibility
Require user authorization before running third-party installers
Protect essential Windows and security services
Preserve original system configurations
Automatic rollback and recovery options
Detailed activity and error logging
Pre-Gaming Optimization Sequence
I’m also considering a loading screen that would:
Perform an initial system health check.
Record baseline resource utilization.
Save the current system configuration.
Apply the user’s selected optimizations.
Wait for background operations and resource utilization to stabilize.
Perform a second resource measurement.
Generate a before-and-after report.
Close the main optimization application.
Automatically launch the selected game and gaming platform.
I don’t want the optimization application itself consuming unnecessary resources while someone is gaming.
I’d also like to offer an optional lightweight background monitor that restores the original settings when the game closes, or a mode that closes everything completely.
I’m planning to use Python, PowerShell, native Windows APIs, and potentially CustomTkinter for the GUI. Windows 11 would be the initial target, with the possibility of supporting other operating systems later.
I’m also planning to incorporate Agile development and ITIL practices, maintain a GitHub repository, document security risks, and validate optimizations through actual performance testing.
For the Python community:
What libraries or frameworks would you recommend?
How would you approach the application architecture?
Are there better ways to interact with Windows services and APIs?
What security or technical challenges should I anticipate?
How would you minimize the application’s resource consumption?
For the gaming community:
What do you routinely do before launching a game?
What optimization techniques have you found genuinely effective?
What features would make you actually want to use this application?
What frustrates you about existing gaming optimization software?
Are there any features you wish existing applications offered?
I don’t want to create another generic FPS booster that blindly disables Windows services, makes unrealistic performance claims, or compromises system security.
I want something transparent, customizable, measurable, and reversible.
I’m open to constructive criticism, feature recommendations, and alternative approaches. I’d potentially like to make it open source so other people can contribute.
What would you add, change, or completely avoid?


r/learnpython • • 1d ago

What would u do?

1 Upvotes

I learned the basics of Python
Now what?
What should I do next?
What would you do if you were at the stage where you had just learned the basics?


r/learnpython • • 1d ago

Inciante em python

0 Upvotes

Alguma dica pra aprender turtle? Sabe aqueles desenhos que fazem em python, realmente fazem do zero ou usam algum programa?


r/learnpython • • 1d ago

Where to start...

8 Upvotes

I know a bit python but not tooo much. If I were to start python from scratch , where would I do that? Also , I need python for data sci and I want to learn a bit about web dev too so what all do I need to learn realistically.

Lastly , where do I get practice questions and projects to build that I can put directly in my portfolio??


r/learnpython • • 2d ago

Any advice for plotting an Atomic orbital energy diagram?

3 Upvotes

The subreddit doesn't let me attach an image so this is a vague rendition of what it looks like.

|
|---- -√2 β
|
|
|--↑-- 0 β
|
|-↑--↓- √2 β

My current idea is using horizontal bar charts with matplotlib.pyplot, but it doesn't have an x-axis and I'm struggling to create the y axis.


r/learnpython • • 2d ago

Have you ever faced issues after installing a new python package?

4 Upvotes

Like for example, you are working on a project where everything is running fine, but then you install a new package for a specific task, but it changes the version of an existing package like numpy or pandas, and suddenly, parts of your old code start throwing errors.

How do you usually fix these issues? Do you use virtual environments or follow any other approach to avoid package conflicts?

Would like to understand what's the common approach for this.


r/learnpython • • 2d ago

5 months into Python: stuck on problem solving and struggling to focus. How do I improve?

3 Upvotes

Hi everyone,

I've been learning Python for about 5 months. I know basics like data types, lists and classes, but I still can't solve problems on HackerRank. When I get a problem, my mind often goes blank. Sometimes I also struggle to understand the statement in English.

I spent the last 3 years consuming a lot of mindless social media content. Now I find it hard to focus and stay disciplined, and reading documentation or books feels difficult.

I'd like advice on:

  1. How can I build logical thinking and problem-solving skills?
  2. How do I get past the "blank mind" stage?
  3. How can I rebuild my focus and discipline?
  4. How can I get better at reading documentation and books?

If you've been through something similar, what actually worked for you?

Honest feedback is welcome. Thanks!


r/learnpython • • 2d ago

advice pls!!!

11 Upvotes

I’m f(17) and I’ve tried to get into python numerous times but this time I want to actually be dedicated to it and eventually build my way up to harder languages.

Anyways please let me know some good YouTubers/sites to learn from as well as projects I could try out! I’m also hoping to make a few friends (close to my age) also learning python to make it more enjoyable.

I’m also open to any other information you think might help me out c: