<jupyter_start><jupyter_text>if,elif,else Statementsif Statements in Python allows us to tell the computer to perform alternative actions based on a certain set of results.Verbally, we can imagine we are telling the computer:"Hey if this case happens, perform some action"We can then expand the idea further with elif and else statements, which allow us to tell the computer:"Hey if this case happens, perform some action. Else if another case happens, perform some other action. Else-- none of the above cases happened, perform this action"Let's go ahead and look at the syntax format for if statements to get a better idea of this:    if case1:        perform action1    elif case2:        perform action2    else:         perform action 3  First ExampleLet's see a quick example of this:<jupyter_code>if True:
    print('It was true!')
if 1==2:
    print("Yes")<jupyter_output><empty_output><jupyter_text>Let's add in some else logic:<jupyter_code>x = False

if x:
    print ('x was True!')
else:
    print ('I will be printed in any case where x is not true')
a = int(input("Enter the Number:"))
if a>0:
    print("Given Number postive:",a)
else:
    print("Given Number is Nagative",a)<jupyter_output>Enter the Number: 10<jupyter_text>Multiple BranchesLet's get a fuller picture of how far if, elif, and else can take us!We write this out in a nested structure. Take note of how the if,elif,and else line up in the code. This can help you see what if is related to what elif or else statements.We'll reintroduce a comparison syntax for Python.<jupyter_code>loc = input("Enter Your location:")

if loc == 'Auto Shop':
    print('Welcome to the Auto Shop!')
elif loc == 'Bank':
    print ('Welcome to the bank!')
else:
    print ("Where are you?")<jupyter_output>Enter Your location: Bang<jupyter_text>Note how the nested if statements are each checked until a True boolean causes the nested code below it to run. You should also note that you can put in as many elif statements as you want before you close off with an else.Let's create two more simple examples for the if,elif, and else statements:<jupyter_code>person = input("Enter Your Name")

if person == 'Reddy':
    print ('Welcome Reddy!')
else:
    print ("Welcome, what's your name?")
    Name = input("Enter your name:")
    print("Your Name is:",Name,"Good To See you Hear")
person = 'Sammy'

if person == 'Sammy':
    print ('Welcome Sammy!')
elif person =='George':
    print ("Welcome George!")
else:
    print ("Welcome, what's your name?")<jupyter_output>Welcome Sammy!<jupyter_text>IndentationIt is important to keep a good understanding of how indentation works in Python to maintain the structure and order of your code. We will touch on this topic again when we start building out functions!1. Unexpected indent2. Expected indent<jupyter_code>a = 2
    if a>10:
    print("Give is Bigger",a)
else:
    print("Give number is small",a)
a = 2
if a>10:
    print("Give is Bigger",a)
else:
    print("Give number is small",a)
a = 2
if a>10:
print("Give is Bigger",a)
else:
    print("Give number is small",a)
a = 2
if a>10:
    print("Give is Bigger",a)
else:
    print("Give number is small",a)<jupyter_output>Give number is small 2
{'fraction_non_alphanumeric': 0.09051186017478152, 'fraction_numerical': 0.007802746566791511, 'mean_word_length': 4.315091210613598, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 22, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '5', 'dir': 'jupyter-structured-clean-dedup', 'id': '258457', 'license': 'MIT', 'n_tokens_mistral': 984, 'n_tokens_neox': 932, 'n_words': 443, 'path': 'Conditional_Stastement/10-If, elif, and else Statements.ipynb', 'repo_name': 'reddyprasade/PYTHON-BASIC-FOR-ALL', 'size': '3204'}