Good news: My book, “Python Workout,” is almost done; I’m working on the videos and final edits, and it’ll soon be available in its final form from Manning, both online and in print. Better news: “Python Workout” is today’s “Deal of the Day,” along with two other Python books: “Data Science Bookcamp” and “Practices of…
Have you ever wondered about bitwise operations in Python? They’re not that common nowadays, but they are still in the language, and can be useful in some cases. A subscriber to my “Better developers” newsletter asked me to explain these. I made a video doing so: Here’s the Jupyter notebook I used in creating the…
My free, weekly “Python for non-programmers” course continues! Our topic for today: Dictionaries, the most important data structure in Python. If you’ve always wanted to program, then it’s still not to late to join us. The course is completely free of charge, and gives you free access to the course recordings (including previous lessons), forever…
Consider the following (ridiculous) Python function: def myfunc(): return 1 return 2 return 3 I can define the function, and then run it. What do I get back? >>> myfunc() 1 Not surprisingly, I get 1 back. That’s because Python reaches that first “return” statement and returns 1. There’s no need to continue onto the…
The next session of my free, weekly, live “Python for non-programmers” course continues tomorrow, on May 8th. You can sign up at https://PythonForNonProgrammers.com/. More than 1,700 people from around the world have already joined! This week’s topics are: Turning strings into lists (and vice versa) Tuples Anyone who joins gets access to all previous recordings,…
A new cohort of Weekly Python Exercise A2 (“Functions for beginners”) starts tomorrow — Tuesday, May 5th. If you’ve been using Python for less than one year, and want to write better, more powerful, more idiomatic functions that do more with less code — then this is the course for you. WPE’s time-tested formula combines…
This is a reminder that my free, weekly “Python for non-programmers” course will continue tomorrow (Friday), May 1st, at 10 a.m. Eastern. In this session, our 7th, we’ll talk abut lists! (This is more exciting than it might sound at first.) The course is 100% free of charge and without obligation. All sessions are recorded…
PyCon didn’t happen in Pittsburgh, as planned, thanks to the coronavirus and covid-19. But it did happen online, and I was delighted to be able to present a talk! Here’s the talk video: And here are the slides, which you can download and use: Please send comments via e-mail to reuven@lerner.co.il or on Twitter to…
It happens to all of us: You write some Python code, but you encounter an error: >>> for i in 10: # this will not work! print(i) TypeError: ‘int’ object is not iterable This isn’t just an error, but an exception. It’s Python’s way of saying that there was a problem in a defined way,…
If you’ve programmed in Python for even a short amount of time, then you’ve probably written a fair number of functions. But many newcomers to Python don’t understand just how useful and powerful functions can be: We can treat functions as nouns, not just as verbs — passing them as arguments, and storing them in…