MODULE-2 OPERATORES
Please implement by using Python
1. A. Write an equation which relates 399, 543 and 12345
B. “When I divide 5 with 3, I got 1. But when I divide -5 with 3, I got -2”—How would you justify
it.
2. a=5,b=3,c=10.. What will be the output of the following:
A. a/=b
B. c*=5
3. A. How to check the presence of an alphabet ‘s’ in word “Data Science” .
B. How can you obtain 64 by using numbers 4 and 3 .
########### Assignments Module 2_Operators #############
## Que.1 (A) ##
#Write an equation which relates 399, 543 and 12345
x = 12345
y = 543
z = 399
equation = 22*y + z
if equation == x:
print('it is a valid relation')
## Que.1 (B)
#“When I divide 5 with 3, I got 1. But when I divide -5 with 3, I got -2”—How would you justify it.
a=5
b=3
a/b
a//b
a = -5
b=3
a/b
a//b
## Que. 2 ##
#a=5,b=3,c=10.. What will be the output of the following:A. a/=b
a=5
b=3
c = 10
a/=b
print(a)
c*=5
print(c)
## Que. 3 ##
#A. How to check the presence of an alphabet ‘s’ in word “Data Science” .
# By using membership operators
"s" in "Data Science"
#B. How can you obtain 64 by using numbers 4 and 3 .
a=4
b=3
a**b