| Keyword | Description | 
|---|
| and | A logical AND operator. Return Trueif both statements areTrue.| x =(5> 3and5< 10)
 print(x)    # True
 | 
 | 
| or | A logical OR operator. Returns Trueif either of two statements is true. If both statements are false, the returnsFalse.| x =(5> 3or5> 10)
 print(x)    # True
 | 
 | 
| as | It is used to create an alias. | importcalendar as c
 print(c.month_name[1])  #January
 | 
 | 
| assert | It can be used for debugging the code. It tests a condition and returns True, if not, the program will raise an AssertionError.| x ="hello"
 assertx =="goodbye", "x should be 'hello'"# AssertionError
 | 
 | 
| async | It is used to declare a function as a coroutine, much like what the @asyncio.coroutinedecorator does.| asyncdefping_server(ip):
 | 
 | 
| await | It is used to call asynccoroutine.| asyncdefping_local():
     returnawaitping_server('192.168.1.1')
 | 
 | 
| class | It is used to create a class. | classUser:
   name ="John"
   age =36
 | 
 | 
| def | It is used to create or define a function. | defmy_function():
   print("Hello world !!")
 my_function()
 | 
 | 
| del | It is used to delete objects. In Python everything is an object, so the delkeyword can also be used to delete variables, lists, or parts of a list, etc. | 
| if | It is used to create conditional statements that allows us to execute a block of code only if a condition is True.| x =5
 ifx > 3:
   print("it is true")
 | 
 | 
| elif | It is used in conditional statements and is short for else if.| i =5
 ifi > 0:
     print("Positive")
 elifi ==0:
     print("ZERO")
 else:
     print("Negative")
 | 
 | 
| else | It decides what to do if the condition is Falseinif..elsestatement.| i =5
 ifi > 0:
     print("Positive")
 else:
     print("Negative")
 | 
 It can also be use in try...exceptblocks. | x =5
 try:
     x > 10
 except:
     print("Something went wrong")
 else:
     print("Normally execute the code")
 | 
 | 
| try | It defines a block of code ot test if it contains any errors. | 
| except | It defines a block of code to run if the try block raises an error. | try:
     x > 3
 except:
     print("Something went wrong")
 | 
 | 
| finally | It defines a code block which will be executed no matter if the try block raises an error or not. | try:
     x > 3
 except:
     print("Something went wrong")
 finally:
      print("I will always get executed")
 | 
 | 
| raise | It is used to raise an exception, manually. | x ="hello"
 ifnottype(x) isint:
     raiseTypeError("Only integers are allowed")
 | 
 | 
| False | It is a Boolean value and same as 0. | 
| True | It is a Boolean value and same as 1. | 
| for | It is used to create a for loop. A for loop can be used to iterate through a sequence, like a list, tuple, etc. | forx inrange(1, 9):
     print(x)
 | 
 | 
| while | It is used to create a while loop. The loop continues until the conditional statement is false. | x =0
 whilex < 9:
     print(x)
     x =x +1
 | 
 | 
| break | It is used to break out a for loop, or a while loop. | i =1
 whilei < 9:
     print(i)
     ifi ==3:
         break
     i +=1
 | 
 | 
| continue | It is used to end the current iteration in a for loop (or a while loop), and continues to the next iteration. | fori inrange(9):
     ifi ==3:
         continue
     print(i)
 | 
 | 
| import | It is used to import modules. | 
| from | It is used to import only a specified section from a module. | fromdatetime importtime
 | 
 | 
| global | It is used to create global variables from a no-global scope, e.g. inside a function. | defmyfunction():
     globalx
     x ="hello"
 | 
 | 
| in | 1. It is used to check if a value is present in a sequence (list, range, string etc.). 2. It is also used to iterate through a sequence in a
 forloop.| fruits =["apple", "banana", "cherry"]
 if"banana"infruits:
     print("yes")
 forx infruits:
     print(x)
 | 
 | 
| is | It is used to test if two variables refer to the same object. | a =["apple", "banana", "cherry"]
 b =["apple", "banana", "cherry"]
 c =a
 print(a isb)   # False
 print(a isc)   # True
 | 
 | 
| lambda | It is used to create small anonymous functions. They can take any number of arguments, but can only have one expression. | x =lambdaa, b, c : a +b +c
 print(x(5, 6, 2))
 | 
 | 
| None | It is used to define a nullvalue, or no value at all. None is not the same as 0, False, or an empty string.None is a datatype of its own (NoneType) and only None can be None.
 | x =None
 ifx:
   print("Do you think None is True")
 else:
   print("None is not True...")      # Prints this statement
 | 
 | 
| nonlocal | It is used to declare that a variable is not local. It is used to work with variables inside nested functions, where the variable should not belong to the inner function. | defmyfunc1():
     x ="John"
     defmyfunc2():
         nonlocal x
         x ="hello"
     myfunc2()
     returnx
 print(myfunc1())
 | 
 | 
| not | It is a logical operator and reverses the value of True or False. | x =False
 print(notx)    # True
 | 
 | 
| pass | It is used as a placeholder for future code. When the pass statement is executed, nothing happens, but you avoid getting an error when an empty code is not allowed. Empty code is not allowed in loops, function definitions, class definitions, or in if statements. | 
| return | It is to exit a function and return a value. | defmyfunction():
             return3+3
 | 
 | 
| with | Used to simplify exception handling | 
| yield | To end a function, returns a generator |