# Control Flow

<figure><img src="/files/ZvhsQReyMdGJbi96rpT0" alt=""><figcaption><p>If_else determines the logic flow of the program</p></figcaption></figure>

* The structure of the if-else statement has the form:

```
if (condition1 is true):
  do A
elif (condition2 is true):
  do B
else:
  do C
```

* example 1: grading test scores

```
In [1]: grade=None

In [2]: score=86

In [3]: if (score>93):
   ...:     grade='A'
   ...: elif (score>85):
   ...:     grade='B'
   ...: else:
            grade='C'    

In [4]: grade
Out[4]: 'B'

```

* example 2: palindrome

```
In [8]: seq1="ACTCA"

In [9]: if seq1==seq1[::-1]:
   ...:     print("%s is a palindrome!" % seq1)
   ...:     
ACTCA is a palindrome!
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://igb.mit.edu/mini-courses/python/introduction-to-python-for-biologists/control-flow.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
