Category: Technical Differences

Difference between pass by value and pass by reference in Python

Introduction In Python, this question can be tricky specially if you come from a C++ background where pass by value and pass by reference is well defined. So what does that mean in Python? This question is repeatedly asked and answered online. My take on that is through the following example… Define 4 data types

Difference between args and kwargs in Python

Introduction I think the reason why this topic can be confusing specially to beginners is that it mixes different concepts together. It should not be hard to understand with proper context. In my opinion, to better understand the difference between Args and Kwargs in Python, the following points must be crystal clear… Positional vs keyword

Difference between break continue and pass in Python

Introduction For more information about for loops in Python, you can find the full article here. So what is the difference between break, continue and pass in Python ? let us borrow some relevant sections from the previous article… Break statement Python like other languages provides a special purpose statement called break. This statement terminates

Difference between assertion and exception in Python

Introduction Software quality assurance is extremely important in software development. The purpose of testing is to uncover serious defects before pushing products to production. Testing should be part of team culture and every member should participate.Test engineers can do black box, integration and system level testing. on the other hand, developers write unit tests. Testing

Difference between and re.match in Python

Table of contents Introduction What is a regular expression? What is Python raw string? Python RE module Python regular expressions syntax summary Regular expressions flags re.match Why use re.match? Regular expression compilation re.match and examples re.fullmatch Match objects re.findall re.finditer re.split re.sub Summary References Introduction Welcome to a new Python code snippets post.