r/learnpython • • Aug 23 '26

Feedback On Fancy Text Printing

2 Upvotes

I've been learning python for years, but I rarely show my code to anyone. I enjoy showing the results of my code to people, but I don't know too many programmers IRL who can give me feedback. I know I have a habit of not commenting enough, but hopefully this is readable. It's my attempt at making text print like in video games (Earthbound, for example.)

Am I doing anything particularly inefficient? I want to know how I can improve this.

from time import sleep
import sys

#Theoretically there could be other wait times for punctuation
punc_default = {" ": 0, ",": 0.25, ".": 0.4, "!": 0.5, "?": 0.5}

def txt(string,time=0.05,punctimes=punc_default):
    for char in string:
        sys.stdout.write(char)
        sys.stdout.flush()
        if char not in punctimes: sleep(time)
        else: sleep(punctimes[char])

txt("Who lives in a pineapple under the sea? Spongebob Squarepants! qwertyuiop.")

r/learnpython • • Aug 21 '26

Best way to learn python for someone with 0 experience with programming

143 Upvotes

I need help with where to begin learning python. I have 0 experience in programming. So I need all the help I can get. Books, websites and courses(free as I can't afford to pay for anything right now) maybe YouTube tutorials.

But on the subject of YouTube tutorials I've seen it's not good to just follow along with the tutorials so what would be the best way of engaging with tutorials?

Please any suggestion is welcome and thank you very much in advance.

What helps you focus I tend to lose focus easily because my brain just suddenly remembers I have something I need to do when I decide to be productive.

Edit: Thank you guys for your suggestions. They've been very helpful. I see all of your replies; I just can't get to every single one of them, but I see them. Thank you very much.

I'm doing CS50P and also using Automate the Boring Stuff and this other book with small projects. Thank you guys so much.


r/learnpython • • Jun 18 '26

I went to superfastpython.com and saw the author wrote "I don't see the need for the books and tutorials, given the era of LLMs." Am I wrong in thinking books are still very important?

23 Upvotes

I'm learning Asyncio at the moment because I want to understand the code LLMs give me.


r/learnpython • • Jul 13 '25

Looking for Python Crash Course, 3rd Edition PDF šŸ™

25 Upvotes

If anyone has the 3rd edition of Python Crash Course in PDF or EPUB and is willing to share, I’d deeply appreciate it.

Thanks a lot šŸ™