# ------------------------------------------------------------------------------------ # Comparision Operators in Python # ------------------------------------------------------------------------------------ # So basically there are 6 Comparison Operators in Python , let us learn them one by one . # Note : One more thing to note is that whenever you compare two "things" , the return value of this Comparision will be either True or False # 1. "=="(Equal) -> we use this operator to see if two variables are equal. a = 5 b = 5 print(a == b) # Here since a and b are equal we will get True in output. # 2. "!="(Not Equal) -> we use this operator to see if two variables are equal or not , if they are not equal it will return True else False. a = 5 b = 5 print(a != b) # Here since a and b are equal we will get False in output. # 3. ">"(Greater than ) -> we use this operator to see if one variable is greater than other. a = 9 b = 5 print(a > b) # Here since a is greater than b , we will get True in output. # 4. ">="(Greater than or equal to ) -> we use this operator to see if two variables are equal or one is grater than the other. a = 5 b = 5 print(a >= b) # Here since a and b are equal, we will get True in output. # 5. "<"(Less than ) -> we use this operator to see if one variable is less than other. a = 9 b = 5 print(a < b) # Here since a is greater than b , we will get False in output. # 6. "<="(Less than or equal to ) -> we use this operator to see if two variables are equal or one is less than the other. a = 3 b = 5 print(a <= b) # Here since a is less than b , we will get True in output. # ------------------------------------------------------------------------------------ # Challenge for you : # ------------------------------------------------------------------------------------ # Given a array of numbers . # Traverse the array and print following : # If the number is less than 10 - print "The number is smaller than 10." # If the number is greater than 10 - print "The number is greater than 10." # If the number is equal t0 10 - print "The number is equal to 10." # The array nums is given below . nums = [1, 3, 10, -7, 8] # write your code here