50% found this document useful (2 votes)
2K views

Assignment Module 2

1. The document provides 3 questions to solve using Python operators. The first question relates numbers 399, 543 and 12345 using the equation 22*y + z, where x = 12345, y = 543, z = 399. The second justifies the results of integer and float division when dividing positive and negative numbers. 2. The second question sets variables a=5, b=3, c=10 and uses a/=b and c*=5 to divide and multiply them, outputting the results. 3. The third question checks for the presence of "s" in the string "Data Science" using a membership operator, and obtains 64 using numbers 4 and 3 with the power operator.

Uploaded by

Kamlesh Nikam
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
50% found this document useful (2 votes)
2K views

Assignment Module 2

1. The document provides 3 questions to solve using Python operators. The first question relates numbers 399, 543 and 12345 using the equation 22*y + z, where x = 12345, y = 543, z = 399. The second justifies the results of integer and float division when dividing positive and negative numbers. 2. The second question sets variables a=5, b=3, c=10 and uses a/=b and c*=5 to divide and multiply them, outputting the results. 3. The third question checks for the presence of "s" in the string "Data Science" using a membership operator, and obtains 64 using numbers 4 and 3 with the power operator.

Uploaded by

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

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

You might also like