<jupyter_start><jupyter_text>Conditional Statements (if, if-else, if-elif, if-elif-else, nested if)<jupyter_code># Example 1 :

x=5
if(x>=5):
    x
    print('Welcome to Python Programming')
    x=x+1
print('The value of x is:',x)
# Example 2:

var1=10
var2=15
if(var1>=var2):
    if((var1-var2)%2==0):
        print('Welcome to Edureka')
    else:
        print('Hello Edureka')
else:
    if((var2-var1)%2==0):
        print('Welcome to Python')
    else:
        print('Hello Python')

        
# Example 3:
a=10
b=15.0
c=a+b
if(type(c) is int):
    print('It is an integer')
elif(type(c) is float):        #Line1
    print('It is a float')
elif(type(c) is float):        #Line2
    print('Yes, it is a float')
else:
    print('The datatype of c is:', type(c))
##Please note that, here in above both the condition mentioned in Line1 and Line2 are valid. But, once one condition is 
##satisfied,it won't check any further condition and it comes out of the flow.
## And also remember that else is not a mandatory block to be written.<jupyter_output><empty_output><jupyter_text>Iteration Control Structure/Loops ( while, for, for-else, usage of continue, break, pass statements<jupyter_code># Example 4
x='Hello'
y=5
while type(x) is str:
    print('hi')
    y+=1
    if(y>9):
        x=y
print('******End******')

# Example 5

for i in range(1,5):
    print(i)
    for j in range(i,i+2):
        if((i+j)%2==0):
            print('Hello')
        else:
            continue

# Example 6

for i in range (5,1,-1):
    j=i
    while(j==i):
        print('hi', i*j)
        i=i+1
    if(i+j)>10:
        continue
    print(i**2)
else:
    print('For loop execution is successful')
        
# Example 7

for var1 in range(1,5):
    for var2 in range(var1+1,5):
        if (var1+var2)%2==0:
            print('hi')
            # Break the inner loop
            break
    else:
        # Continue the outer loop if the inner loop wasn't broken
        continue
    print('hello')
    # Inner loop was broken, now break the outer loop as well.
    break<jupyter_output>hi
hello
{'fraction_non_alphanumeric': 0.1385803959439884, 'fraction_numerical': 0.0294543698696282, 'mean_word_length': 2.673758865248227, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 12, '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': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '291090', 'license': 'MIT', 'n_tokens_mistral': 758, 'n_tokens_neox': 733, 'n_words': 230, 'path': 'Module_01/02_Conditional_Statements_and_Loops_in_Python.ipynb', 'repo_name': 'vijaypattar28/Python_Training', 'size': '2071'}