Conditional statements

I could not get with conditional statements in python. can ay one suggest me the better to get understanding of it

I’m a fan of using the terminal to explore (or you could use python’s online interactive shell!

The basic gist is tied to logical statements. You have connectors like AND/OR, IS and NOT, and whatever your conditions evaluate to (True or False) in combination with these will decide whether a code block gets run.

Piggybacking on the previous example:

>>> condition1 = True
>>> condition2 = False

>>> if not condition1 or not condition2:
...     print("one of these was true")
#output: one of these was true
1 Like

Thanks! I’m going to try it now

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.