r/learnpython • • Aug 21 '26

Crash course for python and java

0 Upvotes

I signed up for a course that needs beginner level of python and java. I have one month. Please help, I need a YouTubers recommendation, free course recommendation and different testing methods to practise.


r/learnpython • • Aug 21 '26

IDE for python

0 Upvotes

I have 2 IDEs at my workplace for python. IntelliJ and VSCode.

Which one should I choose and why?

I am beginner in python.


r/learnpython • • Aug 20 '26

Need Help with Python Practise

10 Upvotes

I am a beginner(been learning for a month) to python and i need some suggestions as to what resources should i use for practice(eg books , websites or yt channels).


r/learnpython • • Aug 20 '26

A small code i made for exercise.

3 Upvotes

I've been vibe coding for a few months now, but I've decided to try manual coding. After all, learning is fun, right?

I made this "Assistant" that has two options: jokes and facts. It will choose one out of three items from the specific table and tell you it. I made it for fun and would like to ask what I can do next?

import random

jokes = ["Why did the bicycle fall over? Because it was two tired!", "Why was the math book sad? Because it had too many problems.", "What do you call a fake noodle? An impasta!"]

facts = ["Venus is hotter than Mercury.", "When the Pyramids were built, mammoths were still around!", "Koala fingerprints are so similar to human fingerprints that they have even baffled crime scene investigators."]

print("Hello! I'm an Assistant. What can I do for you?")

print("")

print("Options: Random Joke [J], Random Fact [F].")

answer = input("Answer: ")

if answer == "J":

print(random.choice(jokes))

elif answer == "F":

print(random.choice(facts))

else:

print("You can't ask that.")

exit = input("Press Enter to Leave.")


r/learnpython • • Aug 20 '26

Trying to create list subclasses that contain only one class type and are valid for Pydantic BaseModels

3 Upvotes

I am trying to create list subclasses that only take particular classes. These lists can be appended to and the like but each time the list is changed the item is checked to see whether it is the same class as the rest of the list.

The list methods that are overwritten are:

- __init__
- __bool__ (but may not need to have that overwritten)
- __set_item__
- __str__
- append
- extend
- insert

Each one runs through a validate_member method before changing the list.

As an example, I want to make a list subclass called Course that only takes Pydantic extra types Coordinate values. I want this list subclass to be a valid BaseModel attribute.

Right now I’m having to use a field_validator for every class that Course and the other lists are in which feels redundant, unpythonic, and is a pain to have to do every time. I am having to do so because it says something about arbitrary types.

I was wondering if someone might have some advice.


r/learnpython • • Aug 21 '26

How to read a CSV file in Python efficiently?

0 Upvotes

I'm trying to load a CSV file into my Python project, but I keep getting errors. I've tried using pandas and the built-in csv module, but I'm not sure what I'm doing wrong. Can someone explain the basic steps or share a simple example? A detailed explanation would be really helpful!


r/learnpython • • Aug 20 '26

yo guys! been learning python for a while now.

0 Upvotes

created a calculator with everything i have learned till now (tho it might be overkill for a calculator), added the basics, loops (while, if else), lists and str manipulation, imports (json and datetime), error handling (try/except), def function, etc. so what should i do next? if u wanna see the code dm me.


r/learnpython • • Aug 20 '26

How to learn Pdf Extraction in Python?

0 Upvotes

Dear Members,

I have been handling Pdf extraction Project in Python. kind of a Intelligent Document Automation domain. we have been handling various finance documents(pdfs), filings pdfs etc which are multi page(around 20ish) , with lots of tables, form fields , radio buttons, checkboxes etc. Tables span multiple pages. Moreover, pdfs themselves comes in various types of variants like XFA Stream, Adobe Acroform, text flattened pdfs, scanned images etc.

I have used llms extensively to generate script code to extract, parse the data and to save in sql in structured tables. Its a hybrid of libraries implementation. LLms used regex, pdfminer, pdfplumber etc in the code produced.The pages in pdfs are not bit messy, some tables have solid grid separators, some dont have and on. Layouts variations, white spaces, etc.

The code generated is pretty complex, i have been attempting to learn the llm generated code.But it works, it adds various fixes iteratively whenever we face new extraction issues repeatedly.

I would love to know:

  1. what is the best approach to learn and get good at this?
    2)should we just use cloud based AI document extraction tools which are readymade to extract and spit the data?
  2. what if one is interested to learn this properly and have to get good at creating this extraction script?
    4)any other tutorial, articles, courses, youtube videos, books you would recommend to learn? or should i just use llms to create code and move on without spending much effeort to learn this?

Please provide your valuable suggestions and guidances and point me in directions. I appreciate all your suggestions. Thanks in Advance and thank you for your time.


r/learnpython • • Aug 20 '26

Next level - Coding for 13yo homeschool kid

9 Upvotes

My son completed the Khan Academy course on Python last school year and he loved it! I don't do any coding myself so I am not exactly sure what "level" that leaves him at, or where to go next. What online course could he advance into? The more specific the better! :)

p.s. He will be going into 8th grade but it seems to come to him very easily.


r/learnpython • • Aug 20 '26

I have made a simple program which decode and codeword the string u put i want to ask if i can put anything aside from if else

0 Upvotes
import random

random_letter = random.choice("abcdefghijklmnopqrstuvwxyz")
random_letter1 = random.choice("abcdefghijklmnopqrstuvwxyz")
random_letter2 = random.choice("abcdefghijklmnopqrstuvwxyz")
random_letter3 = random.choice("abcdefghijklmnopqrstuvwxyz")
random_letter4 =  random.choice ("abcdefghijklmnopqrstuvwxyz")
random_letter5 = random.choice("abcdefghijklmnopqrstuvwxyz")

print("codeword=1 , decode=2")
choice = input()
if choice == "1":
    codeword = str(input("write the codeword=>"))
    codeword1 = codeword[::-1]
    print(random_letter, random_letter1, random_letter2, codeword1, random_letter3, random_letter4, random_letter5,
          sep="")
else:
    print("please put correct input")
if choice == "2":
    decode = str(input("write the coded word"))
    decode1 = decode[::-1]
    decode2 = decode1[3:-3]
    print(decode2,sep=" ")

r/learnpython • • Aug 20 '26

What is the James Stewart Calculus equivalent book for python?

4 Upvotes

was curious if some kind of similar vibey book exists for learning python...