How to do an Excel if in Python
• 1 minIf-clause in Python are pretty similar to what you could find in excel.
In Excel an if formula would look like this.
in Python this translates to
Example
Let's take the example in which I have two cells, A1 with a value of 2 and A2 with a value of 3.
The idea is to add a logic that returns the max value out of the two cells using if.
In Excel that would translate to
In Python
For the example I do print the values when it fulfills the condition in Python
Here you are, you know now how to do an if in Python.