Skip to main content

Posts

Showing posts with the label if structure with example code in python.

- If structure in Python -

Decision Control Structures: The control structures help in making decisions when a program is being executed.  if Statement  : Depending on certain conditions, few statements are executed.  if-else Statement : D epending on a condition;( if true or false), statements are executed.  Elif : It’s a combination of else followed by if.  We all have made many decisions in life. (Here, decisions do not mean a big decision.)Most of our decisions depend on different conditions..isn’t it? some situations in which you had to make a decision?  ● What to order in a restaurant?  ● What to do in my free time?  ● Which movie to watch?  ● Which subject to take an elective?  ● During exams, which question to attempt first? Depending on where you are going, the dress you select to wear will also change ..isn’t it? So let's try an activity. Select the dress, according to a given condition. 1. If going to a party  2. If going out for playing  3. I...