Day 5: --------- 1.Arithmetic Operator 2.Relational Operator (or) Comparision Operator 3.Equality Operator 4.Logical Operator 5.Special Operator 6.Assignment Operator 7.Bitwise Operator QUESTIONS(Theory) ------------------ 1.What are operators in python? 2.What are the arithmetic operators in Python? 3.What is assignment operator with example? 4.How can the ternary operators work in python? 5.Mention the use of // operator in Python? 6.What do you mean by relational operator? 7.How do you use comparison operators in Python? 8.What are the logical operators possible in python? 9.Can we use && in Python? 10.What is Membership operator? 11.What is difference between / and // in python? 12.Is relational Operator works for complex number? 13.What are Arithmetic operator supported by string datatype? 14.Is post increment/decremennt is possible in python? 15.What is mean by chaining of relational operator? Questions(Find the output) ---------------------------------- QUESTION 1: ------------------- QUESTION 1.1: ------------------- Description : Perform following arithmetic operator and return value a=9 b=4 i)a+b ii)a-b iii)a*b iv)a/b v)a%b vi)a//b QUESTION 1.2: ----------------- Description : Perform following arithmetic operator and return value x=12.35 y=3.12 i)x+y ii)x-y iii)x*y iv)x/y v)x%y vi)x//y QUESTION 1.3: ------------------ Description : Perform following arithmetic operator and return value a=20+2j b=5+5j i)a+b ii)a-b iii)a*b iv)a/b v)a%b vi)a//b QUESTION 1.4: ------------------ Description : Perform following arithmetic operator and return value x=False y=True i)x+y ii)x-y iii)x*y iv)x/y v)x%y vi)x//y QUESTION 1.5: ------------------ Description : Perform following arithmetic operator and return value a='Vel' b='Murugan' i)a+b ii)a-b iii)a*b iv)a/b v)a%b vi)a//b QUESTION 1.6: ------------------ Description : Perform following relational operator and return value x=6 y=3 i)xy iv)x>=y QUESTION 2: ------------------ QUESTION 2.1: ------------------ Description : Perform following relational operator and return value x=2 y=8 i)xy iv)x>=y QUESTION 2.2: ------------------ Description : Perform following relational operator and return value a='Greens' b='Tech' i)a=b iv)a>=b QUESTION 2.3: ------------------ Description : Perform following relational operator and return value a='Java' b='java' i)a=b iv)a>=b QUESTION 2.4: ------------------ Description : Perform following relational operator and return value x=True y=False i)xy iv)x>=y QUESTION 3: ------------------- Description : Perform following equality operator and return value a=True b=30 c=22.0 d=False e=22 f="Python" g=30+3j h="python" i)a==b ii)a!= b iii)a==f iv)a!=g v)a!=d vi)a==c i)b==g ii)b!= f iii)b==e iv)b!=g v)b!=d vi)b==c i)f==h ii)a!= b iii)e==c iv)a!=g v)f!=g vi)d==h QUESTION 4: ------------------- Description : Perform following logical operator and return value a=True b=50 c=66.0 d=False e=66 f="Greens" g=50+j h="greens" i)a and b ii)a or b iii)a and f iv)a or g v)a and d vi)a or c i)b and g ii) not f iii)e or f iv)f and h v)b or d vi)b and e i)not b ii) not e iv) not a QUESTION 5: ------------------ Description : Find value of c and d? a=20 b=30 c= a if a < b else b d=b if a>b else a QUESTION 6: ------------------ Description : Find output of below code x = 40 y = 22 print('x > y is',x>y) print('x < y is',x= y is',x>=y) print('x <= y is',x<=y) QUESTION 7: ------------------- QUESTION 7.1: ------------------- Description : Perform following membership operator and return value s ="Welcome to Greens Technology" print('c' in s) print('Greens' in s) print('Come' in s) print('to' not in s) print('M' in s) print('me' not in s) QUESTION 7.2: ------------------- Description : Perform following membership operator and return value s2="Python Class" print('class' in s) print('p' not in s) print('Python' in s) print('C' in s) print('e' not in s) print('Cl' not in s) QUESTION 8: ------------------ Description : What will be output of the following code? x = 5.2 if (type(x) is not int): print ("true") else: print ("false")