0% found this document useful (0 votes)
14 views8 pages

Group Boys Presntation

Uploaded by

dhoob41
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views8 pages

Group Boys Presntation

Uploaded by

dhoob41
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 8

ABAARSO TCHE UNIVERSITY

DIPLOM ATU ICT

GROUP BOYS PRESNTATION


LACTURE: CABDILAADIIF
COURSE:PYTHON
Python Comparison Operators
omparison operators are used to compare two values:

Operator Name Example Try it

== Equal x == y Try it »

!= Not equal x != y Try it »

> Greater than x>y Try it »

< Less than x<y Try it »

>= Greater than or equal to x >= y Try it »

<= Less than or equal to x <= y Try it »


x=5
y=3

print(x == y)

# returns False because 5 is not equal to 3


TRUE
x=5
y=3

print(x != y)

# returns True because 5 is not equal to 3


TRUE

x=5
y=3

print(x > y)

# returns True because 5 is greater than 3


TRUE
x=5
y=3

print(x < y)

# returns False because 5 is not less than 3


FALSE
x=5
y=3

print(x >= y)

# returns True because five is greater, or equal, to 3


TRUE
x=5
y=3

print(x <= y)

# returns False because 5 is neither less than or equal to 3


FALSE
Python Logical Operators
Logical operators are used to combine conditional statements:

Operator Description Example Try it >>

and Returns True if both statements are true x < 5 and x < 10 Try it »

or Returns True if one of the statements is true x < 5 or x < 4 Try it »

not Reverse the result, returns False if the result is not(x < 5 and x < 10) Try it »
true
x=5

print(x > 3 and x < 10)

# returns True because 5 is greater than 3 AND 5 is less than 10


TRUE
x=5

print(x > 3 or x < 4)

# returns True because one of the conditions are true (5 is greater than 3, but 5 is not less than 4)
TRUE

x=5

print(not(x > 3 and x < 10))

# returns False because not is used to reverse the result


FALSE
Python Arithmetic Operators
Arithmetic operators are used with numeric values to perform common mathematical
operations:
Operator Name Example Try it

+ Addition x+y Try it »

- Subtraction x-y Try it »

* Multiplication x*y Try it »

/ Division x/y Try it »

% Modulus x%y Try it »

** Exponentiation x ** y Try it »

// Floor division x // y Try it »


GROUP NAME

1:AXMED CABDI MAXMED


2:SIDIIQ CABDIKARIIN JAAMAC
3:CUMAR

You might also like