Skip to Main Content

Python for Basic Data Analysis

Start your data science journey with Python. Learn practical Python programming skills for basic data manipulation and analysis.

Comparison operators 

Comparison operators 

We use comparison operators to compare between 2 or more values to return either a True or a False.

Operator Syntax Explanation
== x == y x is equal to y
!= x != y x is not equal to y
> x > y x is greater than y
< x < y x is less than y
>= x >= y x is greater than or equal to y
<= x <= y x is less than or equal to y

Click the triangle button to run the codes and see the output:

Video Guide

Exercises

Use the operators to solve for the following equation and print the outputs

1. 3 > 4
2. 3 == 4
3. 15 != 3