If you’re like many of the Python developers I know, the basics are easy for you: Strings, lists, tuples, dictionaries, functions, and even objects roll off of your fingers and onto your keyboard. Your day-to-day tasks have become significantly easier as a result of Python, and you’re comfortable using it ...
Whenever I teach Python courses, most of my students are using Windows. And thus, when it comes time to do an exercise, I inevitably end up with someone who does the following: for one_line in open('c:\abc\def\ghi'): print(one_line) The above code looks like it should work. But it almost certainly doesn’t. ...
I have a great job. Really, I’m quite fortunate: For many years, I’ve spent nearly every day helping engineers at some of the world’s largest and best companies (including Apple, Cisco, Ericsson, HP, PayPal, SanDisk, and VMWare) to become better Python developers. My students are are experienced, intelligent engineers who ...
For nearly two years, I have been teaching my introductory course in data science and machine learning to companies around the world. On the one hand, participants are excited by data science, and all of the potential that it has to change our world. On the other hand, there is ...
In Python, we know that we can add two integers together: >> 2 + 2 4 And of course, we can add two strings together: >> 'a' + 'b' 'ab' We can even add two lists together: >> [1,2,3] + [4,5,6] [1, 2, 3, 4, 5, 6] But what happens ...
What happens when we define a function in Python? The “def” keyword does two things: It creates a function object, and then assigns a variable (our function name) to that function object. So when I say: def foo(): return "I'm foo!" Python creates a new function object. Inside of ...