<jupyter_start><jupyter_text>Boolean Operators<jupyter_code>a = 7
b = 6

print(10 > 9)
print(10 < 9)
print(a > b)

bool() function
print(bool("Nemuel"))
print(bool(1))
print(bool(0))
print(bool(None))
print(bool(False))
print(bool(True))
def my_Function1():
  return True

def my_Function2():
  return False


print(my_Function1())
print(my_Function2())
if my_Function1:
  print("True")
else:
  print("False")

if my_Function2:
  print("False")
else:
  print("True")<jupyter_output>True
False<jupyter_text>Application 1<jupyter_code>print(a==b)
print(a!=a)<jupyter_output>False
False<jupyter_text>Python Operators<jupyter_code>print(10+5)
print(10-5)
print(int(10/5))
print(10*5)
print(10%5)
print(10//5)
print(10/3)
print(10//3) #10/3 = 3.3333
print(10**2)<jupyter_output>15
5
2
50
0
2
3.3333333333333335
3
100<jupyter_text>Bitwise Operators<jupyter_code>c = 60 #binary 0011 1100
d = 13 #binary 0000 1101

c&d
print(c|d)
print(c^d)

print(d<<1) #0001 1010
print(d<<2) #0011 0100<jupyter_output>61
49
26<jupyter_text>Logical Operators<jupyter_code>h = True
l = False
h and l
h or l
not(h or l)<jupyter_output><empty_output><jupyter_text>Application 2<jupyter_code>#Python Assignment Operators

x = 100

x += 3 #Same as x = x + 3, x = 100 + 3 = 103
#x -= 3 #Same as x = x - 3
#x *= 3 #Same as x = x * 3
#x /= 3 #Same as x = x / 3
#x %= 3 #Same as x = x % 3

print(x)<jupyter_output>103<jupyter_text>Identity Operators<jupyter_code>h is l
h is not l<jupyter_output><empty_output><jupyter_text>Control Structure If Statement<jupyter_code>if a > b:
  print("a is greater than b")<jupyter_output>a is greater than b<jupyter_text>Elif Statement<jupyter_code>a = 10
b = 10


if a < b:
  print("a is less than b")
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>if a==b: print("a is equal to b")<jupyter_output>a is equal to b<jupyter_text>Short Hand If...Else Statement<jupyter_code>a = 6
b = 9


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<jupyter_code>if b>a and a==a:
  print("both conditions are True")<jupyter_output>both conditions are True<jupyter_text>Or<jupyter_code>if a<b or b==b:
  print("the condition is True")<jupyter_output>the condition is True<jupyter_text>Nested If<jupyter_code>x = 48

print(x)

if x > 10:
  print("x is above 10")
  if x > 20:
      print("and also above 20")
      if x > 30:
        print('and also above 30')
        if x > 40:
          print("and also above 40")
          if x > 50:
           print("and also above 50")
        else:
          print("but not above 40")<jupyter_output>48
x is above 10
and also above 20
and also above 30
and also above 40<jupyter_text>Week List for loop<jupyter_code>week = ['sunday','monday','tuesday','wednesday','thursday','friday','saturday',]
for x in week:
  print(x.title())<jupyter_output>Sunday
Monday
Tuesday
Wednesday
Thursday
Friday
Saturday<jupyter_text>The break statement<jupyter_code># to display Sunday to Wednesday using a For Loop

for x in week:
  print(x.title())
  if x=="wednesday":
    break
# to display only Wednesday using break statement

for x in week:
  if x =="wednesday":
    break
print(x)<jupyter_output>wednesday<jupyter_text>While Statement<jupyter_code>i = 1
while i < 6:
  print(i)
  i+=1<jupyter_output>1
2
3
4
5<jupyter_text>Application 3 - Create a python program that displays no. 3 using break statement.<jupyter_code>i = 1
while i<6:
  i+=1
  if i==3:
    break
print(i)<jupyter_output>3
{'fraction_non_alphanumeric': 0.1294543429844098, 'fraction_numerical': 0.05679287305122494, 'mean_word_length': 4.870915032679738, 'pattern_counts': {'":': 2, '<': 66, '<?xml version=': 0, '>': 68, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 1, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '18', 'dir': 'jupyter-structured-clean-dedup', 'id': '179222', 'license': 'Apache-2.0', 'n_tokens_mistral': 1613, 'n_tokens_neox': 1451, 'n_words': 389, 'path': 'Operations_and_Expressions.ipynb', 'repo_name': 'nemuelpalomo/OOP-58002', 'size': '3592'}