Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
training
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
arjun.b
training
Commits
1b344aad
Commit
1b344aad
authored
Jan 16, 2023
by
arjun.b
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
calculator
parent
fbfc87ad
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
2 deletions
+16
-2
calcu.py
+16
-2
No files found.
calcu.py
View file @
1b344aad
n1
=
int
(
input
(
"enter the first number"
))
n2
=
int
(
input
(
"enter the second number
\n
"
))
print
(
"1.ADD
\n
2.SUB
\n
3.MUL
\n
4.DIV
\n
"
)
n2
=
int
(
input
(
"enter the second number"
))
print
(
"
\n
"
)
def
add
(
n1
,
n2
):
return
n1
+
n2
def
sub
(
n1
,
n2
):
return
n1
-
n2
def
mul
(
n1
,
n2
):
return
n1
*
n2
def
div
(
n1
,
n2
):
return
n1
/
n2
print
(
"sum="
,
add
(
n1
,
n2
))
print
(
"sub="
,
sub
(
n1
,
n2
))
print
(
"mul="
,
mul
(
n1
,
n2
))
print
(
"div="
,
div
(
n1
,
n2
))
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment