Friday Challenge #2
Here is my second weekly challenge for the LinkedIn’s Python Developers Community. The original post is here. Before you continue reading, see if you can work out the answer yourself. The question is: what...
Here is my second weekly challenge for the LinkedIn’s Python Developers Community. The original post is here. Before you continue reading, see if you can work out the answer yourself. The question is: what...
Complex analysis requires complex code. How do you keep this tidy, ready to evolve and improve? The dream The dream is to create sleek code, which clearly expresses the steps between the problem and...
For the last five weeks I’ve been posting a weekly Python challenge on LinkedIn’s Python Developers Community. It is a bit of fun and a way to stretch the members and show them something...
Discover how iteration works under the hood and how you can tap into this for your own code Here is a very simple for loop: Output: If this looks strange to you, first read...
What do you do if you need some Python support, from a quick answer to affordable regular mentoring or tutoring? Python has a very friendly and helpful community. I have heard it said that...
Here is a simple problem: Count how many times each character occurs in a string. And one more thing: Do this using Python. There are many different solutions to this and each shows us...
How do you increase the value of a variable? Here are a few more operations: If you don’t know some of these operators (e.g. ** or //) check out the Python documentation. Notice how...
The Zen of Python states: “There should be one– and preferably only one –obvious way to do it.” In real life it is not always that easy. There are usually many different ways to...
Say you want to print a numbered list. For instance: Apples Bananas Oranges Pineapple How would you do this? Maybe like this: (The output has a space after each number, which doesn’t look right....
If you come from another language, like C, you may write a loop like this: Or perhaps you have discovered Python’s for loop so you use that to make i equal to 0, 1,...
I was a very experienced programmer when I started using Python. So I wrote some very bad Python code. Each language has its own way of doing things. The more you learn the language,...