python statements code example

Example 1: assert python 3

# Simple asserting thing, run it by using pytest or something 
# If you don't know how to run pytest, then go learn it.

def test_math():
    assert(1 + 1 == 2)

# Another way to test it (without pytest) is:
# You could just run the function to see if it makes an error.
# If it doesn't, it means it was fine, if it does, it means there's an error.

# But then again, using pytest or something is much easier and saves time.
# So try to use testing applications instead of running the function to see.

Example 2: keyword for empty function to continue the block python

# Correct way of writing empty function 
# in Python 
def fun(): 
	pass

  
# Empty loop in Python 
mutex = True
while (mutex == True) : 
	pass

  
# Empty in if/else in Python 
mutex = True
if (mutex == True) : 
	pass
else : 
	print("False")

Example 3: how to write statements in python

print('bruh')
#This is used to make a comment