Commit 5e8e55d7 authored by ramya.r's avatar ramya.r

first commit

parent cdc66eb3
# Default ignored files
/shelf/
/workspace.xml
<component name="InspectionProjectProfileManager">
<settings>
<option name="USE_PROJECT_PROFILE" value="false" />
<version value="1.0" />
</settings>
</component>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.11 (pythonProject2)" project-jdk-type="Python SDK" />
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/pythonProject2.iml" filepath="$PROJECT_DIR$/.idea/pythonProject2.iml" />
</modules>
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<module type="PYTHON_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$">
<excludeFolder url="file://$MODULE_DIR$/venv" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>
\ No newline at end of file
class Calculator:
def SUM(self, a, b):
return a + b
def DIFFERENCE(self, a, b):
return a - b
def MULTIPLICATION(self, a, b):
return a * b
def DIVISION(self, a, b):
return a / b
my_cl = Calculator()
while True:
print("1: SUM")
print("2: DIFFERENCE")
print("3: MULTIPLICATION")
print("4: DIVISION")
print("5: Exit")
ch = int(input("Select operation: "))
if ch in (1, 2, 3, 4, 5):
if (ch == 5):
break
a = int(input("Enter first number: "))
b = int(input("Enter second number: "))
if (ch == 1):
print(a, "+", b, "=", my_cl.SUM(a, b))
elif (ch == 2):
print(a, "-", b, "=", my_cl.DIFFERENCE(a, b))
elif (ch == 3):
print(a, "*", b, "=", my_cl.MULTIPLICATION(a, b))
elif (ch == 4):
print(a, "/", b, "=", my_cl.DIVISION(a, b))
else:
print("Invalid Input")
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment