450a6 No.377[Reply]
Just wanted to share a fun little trip down memory lane, from Python 2.7 to the latest 3.12 version ! Remember when print was still a statement, and type hints were nowhere in sight? Oh, and % formatting was our default buddy! Well, that's all changed now. Check out this throwback code example from Python 2.7: ```python def greet(name): print "Hello, %s" % name ``` Fast forward to today with Python 3.10+, and here's how we write the same function: ```python def greet(name: str) -> str: return f"Hello, {name}" ``` And just when you thought it couldn't get any better…enter Python 3.12! With even more concise typing (hooray for list[str] and | for unions), plus improved error messages, this release has us all pretty pumped ! So, what do you guys think about the evolution of Python functions? I'm curious to hear your thoughts on how these changes have impacted your coding journey. Let's chat in the comments below! ️✨