Exponent operator or power operator division operator

This preview shows page 8 - 10 out of 10 pages.

**=>Exponent Operator or power Operator. Division operator allwayes return Floating point value:- >>> print("a/b=",a/b) a/b= 5.0 Flor Division operator:- a=10 & b=2 >>>print("a//b=",a//b) a//b= 5 c=10.0 & d=2.0 >>> print("c//d=",c//d) c//d= 5.0 fd operator are return same variable type value. Flor means before nearest no {eg.5.25>>>5.0} Exponential operator ---------------------- eg:->>> a=10.5 >>> b=2 >>> print("a**b=",a**b) a**b= 110.25 @if you add string to string only possible... >> print("a+b=",a+b) a+b= javaservolet @if you multification with '*' operator to string to int value only possible.. -------------------------------------------------------------------------------- -- a+b= javaservolet >>> print("a*b=",a*b) Traceback (most recent call last): File "<pyshell#10>", line 1, in <module> print("a*b=",a*b) TypeError: can't multiply sequence by non-int of type 'str' ----------------------------------------------------------------------------- >>> print("a*3=",a*3) a*3= javajavajava ------------------------------------------------------------------------------ 2//Relational operator
Image of page 8

Subscribe to view the full document.

---------------------- >,>=,<,=< >>> a=10 >>> b=20 >>> a>b False >>> a>=b False >>> a=b >>> a>=b True >>> b 20 >>> a 20 >>> a=10 >>> a=b >>> a 20 >>> a=30 >>> a<b False >>> a>b True >>> a=b >>> b 20 >>> b 20 >>> a 20 ======================================== @Based on alphabetical order. >>> a='java' >>> b='python' >>> a>b False >>> a<b True ========================================= Example:- a=10 b=20 >>> if(a>b): print("if statment gone exicute") else: print("else part gone exicute") [else part gone exicute] @In python indentation must required. @chaining of Relactional operator is possible. >>> 10<20<30>40 False >>> 10<20<60 True >>> 10<20<30>26 True @In relactional operator concept we cant compair bet. string & int value. Equalty Operator: --------------------- x#containd operaction only. >>> "durga"=="durga" True
Image of page 9
>>> 10=="durga" False >>> 10==10 True >>> 10!=10 False >>> True==True True chaining operaction:Equalty Operator: ----------------------- >>> 10==5+5==3+7 True All condiction must b true ,if any condiction is false total gone false. @ String and int not comparable gating false. >>> 97=='a' False @ Complex no comparagen possible. >>> 10+5j==10+5j True 3//LOGICAL OPERATOR ---------------------------- and / or / not and=if both argument is true then true or=atlist one argument true then true not= BOOLEAN: @and operator ,when both operator is getting true then only its retur n true,otherwise giveing false. @or operator , in both operator suppose one is true then its return true. NONBOOLEAN: @If x is avaluat to false then reyurn x,otherwise return y. >>> 0 and 10 0 >>> 10 and 20 20 @//BITWISE OPERATOR: ----------------------------- &,|,^,~,<<,>> use in int type in boolean type any other not possible.
Image of page 10
  • Fall '19

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern

Ask Expert Tutors You can ask You can ask ( soon) You can ask (will expire )
Answers in as fast as 15 minutes