In Python, an assertion is a statement that confirms something about the state of your program. For example, if you write a createUser function and you are sure that the user needs to be older than 18, you assert that the age field is greater than or equal to 18. You can think of an assert statement like a unit test that is performed at runtime.
While lists aren’t the most efficient data structure if you’ll be doing lots of deleting from the middle, there are definitely good ways to accomplish the task. The built-in remove() method should be your first option. Let’s go over some examples.
Developers love concise code that’s easy to read, and that’s exactly what ternary operators are for. The ternary operator in Python lets you perform a small if/else statement in a single line. Let’s take a look at a few examples.
Let’s go over a few idiomatic ways to remove duplicates from lists in Python. Method #1 - Create a new list (simplest) This is the easiest algorithm to code, but because it requires creating a new list, also requires more memory and is a bit slower.
When working with files in Python, you’ll often need to check if a file exists before you do anything else with it, such as reading from or writing to it. Luckily, the Python standard library makes this a piece of cake.
Generics in Go have been released with Go 1.18! This is one of the most eagerly-awaited features since the release of the language. Many devs have gone so far as to say Go’s previous lack of generic types made the language too painful to use at all. Let’s dive into what generics are, why you might use them in your own projects, and how they work in Go.
There is a common trap that we fall into as developers, and it is believing that because some code “worked” that the code was written “correctly”. In reality, for most technical problems, a good developer can likely point out several different solutions. Any of those solutions might be perfectly reasonable, while none of them is the single “correct way”.
A while back I went through the interview process at a company I won’t name here. The first interview was basically just a phone screen, where I was able to chat with my would-be manager about things like compensation range, tech stack, work duties, etc. It went well! The guy was delightful.
It’s either a blessing or a curse when choosing to learn Python or C++ because there couldn’t be two more opposing languages to compare.
When comparing programming languages, it’s not often that you come across two that actually work well together, but that happens to be the case when it comes to PHP and JavaScript.
So you’re a fan of web development? Great! You’re probably already familiar with JavaScript (if not, check out our JavaScript course here) and may have heard of Node.js as well. But which one is better, and how are they different? When should you pick Node.js vs JavaScript?
PHP famously claims to be the backend programming language for just under 80% of the Internet. However, if you look at the popularity rankings of programming languages, Python is consistently far ahead of PHP. How can that be? Both languages can be used for backend web development, and PHP was even specifically made for web development.
When broken down into core features – like programming style and code execution – JavaScript and Ruby seem deceivingly similar, but there are a few constitutional differences.
It’s hard finding good product people. That fact is really a tragedy because they are probably the most important part of any product-focused organization. I think there is a misconception in the software industry that product managers have a good sense of “what users want”, “what the next feature should be” or “ux design”. In reality, I’ve come to believe that the best product managers aren’t good at any of that, and they know it.
A ruby is a beautiful red gemstone; a python is a beautiful green snake. Aside from that, they’re both very popular programming languages. They’re popular for different reasons, and they’re good at different things. Before you choose between Ruby vs. Python, make sure you ask yourself these 10 questions.
Everyone wants to know the best way to learn to code Python nowadays. It’s a great language, as I’ve written about before, with great career prospects and tons of useful features.
Really good JavaScript projects for beginners can be tough to find. Sometimes they’re too hard, or assume too much prior knowledge. Sometimes they’re actually too easy, and don’t push you to develop any solid JavaScript skills. (Cough cough, that tic-tac-toe game I know you’ve probably seen recommended about a thousand times by now.)
JavaScript (JS), once regarded as simply a “glue language”, has gone on to become the most popular programming language in the world.
I’ve made no secret of the fact that I love Python, and that I believe one of the best ways to learn Python is by finding an awesome project you care about to work on. There’s nothing more stimulating than passion and curiosity, and that makes the best projects for Python beginners usually something a little grittier than the standard tutorials.
We recently took a look at our course curriculum and felt that our current Learn Algorithms course, written in Go, would be better served if it covered Python instead. After much deliberation, we decided to rewrite the course, and we’re super excited to have now released the course in Python!
HTML, CSS, and JavaScript are the most important tools in your arsenal for all your web design escapades. Rather than compete, they complement and augment each other, and their power expounds when they’re combined – like internet Power Rangers.
This article contains some of my thoughts on communications for distributed teams and is a response to No, we won’t have a video call for that! by Florian Hass. Read his article first if you haven’t yet, he makes some great points!
In 2009, the computer science world was blessed with two powerful tools: Golang and Node.js.
Golang and C# offer a unique mixture of similarities and differences, having both been inspired by the same language, C.
Rust and Python contrast in a unique way because while they both provide back-end web support, Python thrives as a flexible and consistent language, while Rust makes a name for itself with raw power and speed.