Logical Operator
Logical Operator
+
-
*
/
Logical operator
operator Keyboard Python
Equals = ==
Not Equals <> !=
less than < <
greater than > >
less than or <= <=
equals
greater than or >= >=
equals
Answers Assignment 2:
1. Print "Hello World" if a is not equal to b.
if a!=b:
print(‘Hello’)
if a = b:
print(‘1’)
elif a > b:
print(‘2’)
else:
print(‘3’)
if a == b and c == d:
print(‘Hello’)
6.) Print "Hello" if a is equal to b, or if c is equal to d.
if a ==b or c ==d:
print(‘Hello’)
Answers Assignment 1–
a=b=c=’Beethoven’
print(a)
print(b)
print(c)