<jupyter_start><jupyter_text>Boolean Operators<jupyter_code>print(10>9)
print(10==9)
print(10<9)<jupyter_output>True
False
False<jupyter_text>bool() functions<jupyter_code>print(bool("Gabriel"))
print(bool(19))
print(bool([]))
print(bool(0))
print(bool(1))
print(bool(None))
print(bool(False))<jupyter_output>True
True
False
False
True
False
False<jupyter_text>Functions can return Boolean<jupyter_code>def myFunction():
 return False

print(myFunction())
def myFunction():
 return True

if myFunction():
    print("YES!")
else:
    print("NO!")<jupyter_output>YES!<jupyter_text>TRY Application 1<jupyter_code>print(10>9)

a=60
b-13



print(a==b)
print(a!=a)<jupyter_output>True
False
False<jupyter_text>Python Operators<jupyter_code>print(10+3)
print(10-3)
print(10*3)
print(10/3)
print(10%3)<jupyter_output>13
7
30
3.3333333333333335
1<jupyter_text>Bitwise Operators<jupyter_code>a=60
b=13
#a = 60, binary 0011 1100
#b = 13, binary 0000 1101

print(a&b)
print(a|b)
print(a^b)
print(a<<1)
print(a<<2)<jupyter_output>12
61
49
120
240<jupyter_text>Application 2<jupyter_code>#Assignment Operators
x = 2
x+=3 # the same as x= x+3 
print(x)
x-=3 # the same as x= x+3 
print(x)
x*=3 # the same as x= x+3 
print(x)
x/=3 # the same as x= x+3 
print(x)
x%=3 # the same as x= x+3 
print(x)<jupyter_output>5
2
6
2.0
2.0<jupyter_text>Logical Operators<jupyter_code>k = True
l = False
print(k and l)
print(k or l)
print(not(k or l))<jupyter_output>False
True
False<jupyter_text>Identity Operators<jupyter_code>k is l 
l is not l<jupyter_output><empty_output><jupyter_text>Control Structureif Statement<jupyter_code>v = 1 
z = 2
if 1<2:
  print("1 is less than 2")<jupyter_output>1 is less than 2<jupyter_text>Elif Statement<jupyter_code>if v<z:
  print("v is less than z")
elif v>z:
  print("v is greater than z")<jupyter_output>v is less than z<jupyter_text>Elif Statement<jupyter_code>number = int(input()) # to know if the number is positive or negative

if number>0:
 print("positive")
elif number<0:
 print("negative")
else:
 print("number is equal to zero")<jupyter_output>2
positive<jupyter_text>Application 3 - Develop a Python program that will accept if a person is entitled to vote or not<jupyter_code>age = int(input())

if age>=18:
  print("You are qualified to vote")
else:
  print("You are not qualified to vote")<jupyter_output>1
You are not qualified to vote<jupyter_text>Nested if<jupyter_code>u = int(input())
if u>10:
  print("u is above 10")
if u>20:
  print("u is above 20")
if u>30:
  print("u is above 30")
if u>40:
  print("u is above 40")
if u>50:
  print("u is above 50")
if u>60:
  print("u is above 60")
else:
  print("u is below 60")<jupyter_output>69
u is above 10
u is above 20
u is above 30
u is above 40
u is above 50
u is above 60<jupyter_text>Looping statement<jupyter_code>week = ['Sunday','Monday','Tueday', 'Wednesday','Thursday', 'Friday', 'Saturday']
season = ["rainy", "sunny"]
for x in week:
 for y in season:
  print(y,x)<jupyter_output>rainy Sunday
sunny Sunday
rainy Monday
sunny Monday
rainy Tueday
sunny Tueday
rainy Wednesday
sunny Wednesday
rainy Thursday
sunny Thursday
rainy Friday
sunny Friday
rainy Saturday
sunny Saturday<jupyter_text>The break statement<jupyter_code>for x in week:
  if x =="Thursday":
    break
print(x)

for x in week:
  if x =="Thursday":
    break
  print(x)<jupyter_output>Sunday
Monday
Tueday
Wednesday<jupyter_text><jupyter_code>#TO display Sunday to Thursday

for z in week:
  if z =="Friday":
    break
  print(z)<jupyter_output>Sunday
Monday
Tueday
Wednesday
Thursday<jupyter_text>While<jupyter_code>i= 1
while i<6:
  print(i)
  i+=1<jupyter_output>1
2
3
4
5<jupyter_text>Application 4- Create a Python program that display number from 1 - 4 using While loop statement<jupyter_code>g= 1

while g<=4:
 print(g)
 g+=1<jupyter_output>1
2
3
4<jupyter_text>Application 4- Create a Python program that display number 4 using While loop statement and break<jupyter_code>g= 1

while g<=4:
 if g==4:
   print(g)
 g+=1<jupyter_output>4
{'fraction_non_alphanumeric': 0.12331165582791395, 'fraction_numerical': 0.04902451225612806, 'mean_word_length': 6.103019538188277, 'pattern_counts': {'":': 3, '<': 73, '<?xml version=': 0, '>': 73, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 1, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '20', 'dir': 'jupyter-structured-clean-dedup', 'id': '40707', 'license': 'Apache-2.0', 'n_tokens_mistral': 1783, 'n_tokens_neox': 1627, 'n_words': 438, 'path': 'Operations_andExpressions.ipynb', 'repo_name': 'Borvs/OOP-58001', 'size': '3998'}