<jupyter_start><jupyter_text>If Statement<jupyter_code>a=15
b=20

if b>a:
  print("b is greater than a")<jupyter_output>b is greater than a<jupyter_text>Elif Statement<jupyter_code>a=150                                   #Change a value to a greater number
b=20

if b>a:
  print("b is greater than a")
elif a>b:
  print("a is greater than b")<jupyter_output>a is greater than b<jupyter_text>Else Statement<jupyter_code>a=150
b=150

if b>a:
  print("b is greater than a")
elif a>b:
  print("a is greater than b")
else:
  print("a is equal to b")<jupyter_output>a is equal to b<jupyter_text>Short Hand If Statement<jupyter_code>#For one condition to execute

a=15
b=20

if a>b: print("a is greater than b")<jupyter_output><empty_output><jupyter_text>Short Hand Else Statement<jupyter_code>a=15
b=20

print("a is greater than b") if a>b else print ("b is greater than a")<jupyter_output>b is greater than a<jupyter_text>And Logic Condition (&)Both conditions are true<jupyter_code>x=7

if x>5 and x>6:
  print("Both conditions are true")<jupyter_output>Both conditions are true<jupyter_text>Or Logic Condition<jupyter_code>x=19

if x>18 or x<15:
  print("True")

x=18

if x>18 or x<15:
  print("True")
else:
  print("False")<jupyter_output>True
False<jupyter_text>Nested If<jupyter_code>x=18

if x>10:
  print("Above 10")
  if x>20:
    print("Above 20")
  else:
    print("Below 20")
else:
  print("x is less than 10")<jupyter_output>Above 10
Below 20<jupyter_text>Example 1<jupyter_code>age=18


if age>=18:
  print("You are qualified to vote")
else:
  print("You are not qualified to vote")

age=17


if age>=18:
  print("You are qualified to vote")
else:
  print("You are not qualified to vote")

age=int(input("Enter you age:"))


if age>=18:
  print("You are qualified to vote")
else:
  print("You are not qualified to vote")<jupyter_output>You are qualified to vote
You are not qualified to vote
Enter you age:19
You are qualified to vote<jupyter_text>Example 2<jupyter_code>number=float(input("Enter the number:"))

if number==0:
  print("Zero")
elif number>0:
  print("Positive Number")
else:
  print("Negative Number")<jupyter_output>Enter the number:-9
Negative Number<jupyter_text>Example 3<jupyter_code>grades=float(input("Enter your grades:"))

if grades>=75:
  print("Passed")
elif grades>74:
  print("Remedial")
else:
  print("Failed")<jupyter_output>Enter your grades:74.1
Remedial
{'fraction_non_alphanumeric': 0.12108559498956159, 'fraction_numerical': 0.03382045929018789, 'mean_word_length': 5.440860215053763, 'pattern_counts': {'":': 0, '<': 37, '<?xml version=': 0, '>': 54, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '11', 'dir': 'jupyter-structured-clean-dedup', 'id': '636855', 'license': 'Apache-2.0', 'n_tokens_mistral': 976, 'n_tokens_neox': 910, 'n_words': 255, 'path': 'Control_Structure&Example_3.ipynb', 'repo_name': 'Itto-ryu/CPEN-21A-CPE-1-2', 'size': '2395'}