Exercises in .NET with Andras Nemes
Introduction
In the previous post we looked at how to assign nulls to a variable using the None keyword. In this post we’ll look at Python’s relational operators. These are operators that help us compare two values.
Those of you who have experience with other object-oriented languages like C# or Java can safely skip this post. The relational operators are the same in Python: ==, !=, ,=.
Relational operators
You’ll be familiar with most of them from the maths classes:
- == : is equal to
- != : is not equal to
- < : less than
- > : more than
- <= : less than or equal to
- >= : greater than or equal to
The first two may look strange at first. We’ve already seen the operator that most people recognise as equality: ‘=’. However, we didn’t use it to compare two values but to assign a value to an operator…
View original post 163 more words