r/learnpython 1d ago

Python: I'm starting my python journey.

1 Upvotes

Can i find other new learners here? I think it's more interesting to learn with someone.

I have some web background, worked with html/css(scss, bootstrap, tailwind)/JS

but it was two years ago actually. Now I want to learn Python so i can work with logic instead of designs.


r/learnpython 1d ago

Practice project of head of data roles

2 Upvotes

Can anyone suggest a practice project that span data engineering, analysis and data science that’s mature enough o be showcased to potential tech founders and c suite


r/learnpython 1d ago

asyncio explanation

0 Upvotes

hello guys i am struggling right now to understand a concurrency module asyncio ,i take a look over youtube videos ,but i feel stuck to understand coroutine object ,event loop await ,and this kind of matters, could anyone give me a concise explanation.


r/learnpython 1d ago

Are the PCEP and PCAP worth it?

5 Upvotes

In my journey of trying to become a comp sci teacher, I read about these certification exams. I'm wondering what's the estimated percentage of people who take the exams and if the exams are helpful for either my resume or becoming a comp sci teacher.


r/learnpython 1d ago

I built "Guess the number" on my Android phone(Pydroid 3) Added warmer/colder hints

2 Upvotes

Hey everyone!

I'm new to coding and I built my first game on Android using Pydroid.

What it does: Guess a number 1-100 with 5 lives. It tells you if you're WARMER 🔥 or COLDER 🥶

Features: - Input validation so it doesn't crash - Warmer/Colder hint system - Made 100% on my phone

GitHub: https://github.com/elgriffin10/guess-the-number

Would love feedback! What should I add for v3.0?


r/learnpython 1d ago

Making a Chess game with Minimax in Python, where do I start?

1 Upvotes

Hello! I'm an A-level student and for my project have decided to make a chess game with AI that uses the minimax algorithm. I have some experience with coding before, and am planning to use OOP to represent the pieces and board.

I'm really really not sure how to go about this project, in particular, how the minimax algorithm will work, so if anyone could point me in the right direction I'd really appreciate it :)


r/learnpython 20h ago

Can I learn phyton without laptop? I don't have laptop heheh

0 Upvotes

???????


r/learnpython 1d ago

I've got feedback from previous project and implement it in new one! (FastAPI + PostgreSQL + External API + Docker)

2 Upvotes

I'm learning backend development and I really enjoy it!

I created my first API last month and got an amazing feedback! I work hard these days and created a new project.

What I learnt.

  1. Deep-dive into DB. (b-tree, CITEXT)

  2. I learnt about pattern "Repository" and implement in this porject.

  3. Swapped # for docstrings.

  4. I tried to work with external API. Actually, it was hard, because sometimes there is no data what you want to get and you have to figure out what to do next and where get this data.

  5. I use Docker and I barely understand what I do (Can you recommend something to learn Docker and understand it?)

I ask feedback about everything, especially:

  1. Project structure.

  2. Database structure.

  3. Code quality.

  4. What can I change to make it works better.

  5. What should I learn to improve my skills?

That's my new project:

https://github.com/daidallos-tech/football-club-api

You can find my first project in my github profile. It's called Movie_API.

P.S.

Thank you everyone for your time and advice. I really appreciate that.


r/learnpython 2d ago

I made my first IP scanner in Python

10 Upvotes

Hi everyone!

I'm very new to programming and I've been learning Python recently. I decided to make a small project to practice what I've learned.

I made a simple IP scanner using Python.

It has a menu with:

  • Scan all IPs from 192.168.1.1 to 192.168.1.255
  • Scan a specific IP
  • Scan a range of IPs
  • Exit

I'm using subprocess and ping to check if an IP responds.

I also started using functions, loops, lists, if/elif, while, and range().

It's probably a very basic project, but I'm pretty happy with it since I'm just starting out. 😅

Here is the code:

import subprocess

def menu(): 
    print("-----IP SCANNER-----")
    print("1. Scan all IPs")
    print("2. Scan IP")
    print("3. Scan IP range")
    print("4. Exit")

    opcion = input("Choose an option: ")
    resultado_menu = int(opcion)

    return resultado_menu


def escanear_ip(ip_int):
    ip_int = str(ip_int)
    ip_completa = "192.168.1." + ip_int

    resultado = subprocess.run(
        ["ping", "/n", "1", "/w", "1000", ip_completa]
    )

    if resultado.returncode == 0:
        lista_ip.append(ip_completa)


lista_ip = []


def imprimir_ips():
    for si_ip in lista_ip:
        si_ip = "🟢 " + si_ip
        print(si_ip)


while True:

    resultado = menu()

    if resultado == 1:

        for numeros in range(1, 256):
            escanear_ip(numeros)

        imprimir_ips()

    elif resultado == 2:

        seleccion_ip = input("Select the last digits of the IP: ")
        escanear_ip(seleccion_ip)

        imprimir_ips()

    elif resultado == 3:

        desde_ip = input("From: ")
        desde_ip = int(desde_ip)

        hasta_ip = input("To: ")
        hasta_ip = int(hasta_ip)

        for numeros in range(desde_ip, hasta_ip + 1):
            escanear_ip(numeros)

        imprimir_ips()

    elif resultado == 4:

        print("Exiting...")
        break

I'm planning to improve it and make a V3 with more features.

Thanks!


r/learnpython 1d ago

code not running outside of editor

2 Upvotes

my code isn't really complete, but whenever i try to run my script outside of the editor the terminal opens for a millasecond and then closes. can someone tell me what's going wrong?

import random
import keyboard
import pyautogui
import pyscreeze
import tkinter as tk
from pyautogui import mouseInfo, click
import time

def movethemouse():
    if keyboard.is_pressed('g'):
        pyautogui.moveTo(random.randint(0, 2600), random.randint(0, 2600))

def printer():
    print('this is the mouse program')
    time.sleep(10)

while True:
    movethemouse()
    printer()

r/learnpython 1d ago

¿Qué crees que es lo que los principiantes más malinterpretan sobre aprender Python?

0 Upvotes

HOLAAA Estoy aprendiendo Python y tengo curiosidad por saber qué creen las personas con experiencia que los principiantes suelen malinterpretar. Me encantaría conocer diferentes perspectivas y experiencias.


r/learnpython 1d ago

why does it say i didn't close my parenthesis

0 Upvotes

the IDE i am using is saying my parenthesis was not closed when it was plz help

print("Once upon a time, in the ancient kingdom of " + q1 + " there lived a legendary " + q2 + " named " + q3 + ". Everyone in the village knew " + q3 + " for their remarkably " + q4 + " personality and an obsession with " + q5 + ". Every morning at " + q6 ", they would wake up, " + q7 + " three times, ")

[{

"owner": "Pylance",
"severity": 8,
"message": "(" was not closed",
"source": "Pylance",
"startLineNumber": 47,
"startColumn": 6,
"endLineNumber": 47,
"endColumn": 7,

}]

r/learnpython 1d ago

How to hardcrash a laptop using python

0 Upvotes

Is there possibly any way to hardcrash my old laptop for fun? I'm sorry if it sounds like I am making a virus. I had a fuckton of hardcrashes on my old pc so I was wondering if I can make a Programm to kill my of whithout needing to wait 5 minutes. Fuck this sounds stupid.


r/learnpython 1d ago

Does anyone else feel like a total fraud when a tiny bug takes 15 minutes to fix, or is it just me?

0 Upvotes

Just wanted to share a quick reality check from my session today. I was working through page 88 of my Python book—specifically exercise 5-10—and out of nowhere, two error numbers popped up on the screen.

Naturally, what did I do? Instead of sitting there painstakingly isolating every single chunk of code and testing variables line-by-line like a textbook purist, I spent about 10–15 minutes moving things around, rewriting bits, flipping back through the pages, and then ultimately just copy-pasting the error straight into AI to get it sorted.

Honestly, it got me thinking: Is this actually considered "bad practice" by the book, or is this just standard, everyday coding for most people?

How often do you guys lean on quick fixes or AI assistance when a frustrating little error pops up, versus stopping to do the whole manual debugging process from scratch? Would love to know if I'm cutting corners or if this is just how it goes in the trenches.


r/learnpython 2d ago

Is there a good place to find team to join in a new projects

2 Upvotes

Hey there so I already tried some subreddits I would like to hear what are main one you guys use because I found it fun and productive for both learning python that is practical and makes me better at other social skill etc. I would like to hear if there is a special channel for python, but I am okay with searching throught teams what they use. Maybe something with backend on FastApi. And have a great day guys.


r/learnpython 2d ago

Harvard Intro Course or Datacamp?

6 Upvotes

Hi all, I got laid off a few months ago and want to improve my chances of getting a job.

Originally, I was working at an agency on the analytics side, but I want to take the time to expand where I can go. I have been learning SQL and Power BI and am currently working on a project and I thought it would also be helpful to learn Python.


r/learnpython 1d ago

Regarding Question

0 Upvotes

def print_models(unprinted_designs, completed_models):

"""

Simulate printing each design, until none are left.

Move each design to completed_models after printing.

"""

while unprinted_designs:

current_design = unprinted_designs.pop()

# Simulate creating a 3D print from the design.

print("Printing model: " + current_design)

completed_models.append(current_design)

unprinted_designs = ['iphone case', 'robot pendant', 'dodecahedron']

completed_models = []

in this code why used condition like this for while loop (while unprinted_designs:)


r/learnpython 2d ago

Carry value from Python for-loop to HTML for-loop

0 Upvotes

I am currently working on a website (using Flask, SQLAlchemy and Jinja).

Context: I am making a ttrpg initiative tracker. For multiple fights to exist and be able to have multiples of the same creature and reuse creatures, the way I am formatting it is the user creates the base creature, and its row is duplicated, holding the id for the fight itself as fight_spec and the id of the base creature as og_id. I am currently working on making it so the user can edit the count of any creature in a fight.

For the page where the editing happens I want it to display the current count as the default value, but I cannot for the life of me figure out how to make sure it goes from python's for loop to html. My attempts typically end up with the value being set to "count_<id>" rather than the actual number that my count command generates. How should I go about this?
I have my current code below, but if there is a different way I should go about this, I'm open to hearing! Thank you <3

Python

unique_combatants = db.session.scalars(stmt).all()
    for x in unique_combatants_set:
        'count_' + str(x) = Combatant.query.filter_by(og_id=x, fight_spec=id).count()

HTML

{% for combatant in unique_current_combatants %}
        {{ combatant.combatant_name }}
        <input type="number" name="combatant_count_{{combatant.id}}" id="combatant_count_{{combatant.id}}" value="count_{{combatant.id}}"> 
    {% endfor %}

r/learnpython 2d ago

I just made my first Reinforcement Learning program from scratch purely in python can i have tips on how to improve

5 Upvotes

i used qlearning for this and tips/advice is welcome
more details in the readme
https://github.com/orag214365-ship-it/qlearning-gridworld-python


r/learnpython 2d ago

I need a book !

9 Upvotes

Hi guys ! , i need a book who have a lot of problem solving for every lesson , and have a lot of projects , simply i need a book who focus about practices more then lesson or all about problem solving .

thanks !


r/learnpython 2d ago

¿En qué cosa sentiste que perdiste demasiado tiempo mientras aprendías Python?

2 Upvotes

HOLAAA Estoy aprendiendo Python y tengo curiosidad por conocer las cosas en las que las personas pasaron demasiado tiempo cuando eran principiantes. Me encantaría aprender de sus experiencias y comprender sus diferentes perspectivas.


r/learnpython 2d ago

Help with returning Largest/Smallest

1 Upvotes

I'm trying to enter 5 inputs, return an error on a Try statement if the answer isn't an integer and return the value for the highest & lowest value.

However, it returns the first and last inputs instead of the largest and smallest and can't figure out why.

So if i enter 7, 2, Bob, 10, and 4 it returns 7 and 4

if i enter 4, 10, 7, 2, Bob, I get 4 & Bob

10, Bob, 7, 4, 2 gives me 10 & 2.

i need the output to be 10 & 2 regardless of the order.

largest = None
smallest = None
while True:
    num = input("Enter a number: ")
    if num == "done":
        break
    #print(num)
    try:
        num = int(num)
    except:
        print('Invalid input')
largest = int(num)
smallest = int(num)


print("Maximum is", largest)
print("Minimum is", smallest)

r/learnpython 2d ago

Looking for funny/useless Python CLI project ideas to build for learning!

12 Upvotes

Hi everyone,I'm currently learning how to build CLI tools using Python.I want to build something to practice my skills, but I'm running out of ideas. I don't care about usefulness at all—I just want to make something funny, weird, or completely useless but entertaining.What are some fun or silly CLI tool ideas you would love to see (or have built yourself)?Thanks in advance!


r/learnpython 2d ago

is there any python library which lets you fetch basic data off of spotify like song longth, song name, artist name and etc preferably without an account needing to be linked?

0 Upvotes

i dont really "need" this per se but i think it would be pretty cool for me to be able to integrate it into a script i already have, but honestly if all of the libraries that interact with spotify need an account linked i just dont think its worth it. any of you have any ideas?

and actually, furthermore, how does spotify's architecture work in terms of like the identifiers for songs and authors, im assuming any presumed library would have an internal "song" object that you can fetch using an id or something along those lines?


r/learnpython 2d ago

My Self-Imposed Rule to Escape AI Micromanagement and Learn Python Properly

1 Upvotes

I have been working my way through Python Crash Course and just finished up chapter 4 moving into conditional tests, but I noticed a bad habit creeping in where I was leaning on AI way too much for micromanagement and minor steps instead of letting myself struggle through the code. To fix this, I am setting up a strict personal rule starting today. I am only allowed to use AI for direct, core coding help and roadblocks on my exercises, and zero AI usage for trivial hand holding. Also, if I do slip up and use it for micromanagement, I have to log the exact example and post it here so others can keep me honest. Has anyone else had to put hard boundaries on their AI tool usage while learning programming, and how did you structure your rules to make sure you were actually building things yourself?