particular action to perform depending on the conditions. To do this, Python
uses the “if statement” to check the program current state before responding
suitably to that state. However, in this chapter, you will be exposed to
various ways to write conditional statements. Furthermore, you will learn
basic “if statements,” create complex if statements and write loops to
handle items in a list. There is so much more loaded in this chapter for you
to learn. Without further ado, let us begin with a simple example.
The program below shows how you can use “if statement” to respond to a
Do'stlaringiz bilan baham: |