Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create calculator_cla #16

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions Day-04/calculator_return
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
def add(a, b):
add=a+b
return add

def sub(a, b):
subtraction=a-b
return subtraction

def mul(a,b):
mul=a*b
return mul

#print(addition(5,10))
#print(subtraction(10,5))
#print(mul(20,10))
9 changes: 9 additions & 0 deletions Day-05/ENV_VAR.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#first you need to export the sensitive information
#export password= "srilakshmi"
#export apitoken= "abcdefghijk"
#In the script import the OS module

import os

print (os.env.password)
print (os.env.apitoken)
37 changes: 37 additions & 0 deletions Day-05/calculator_cla
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import sys

def add(a, b):
add=a+b
return add

def sub(a, b):
subtraction=a-b
return subtraction

def mul(a,b):
mul=a*b
return mul

#print(addition(5,10))
#print(subtraction(10,5))
#print(mul(20,10))

#a=int(sys.argv[1])
a=float(sys.argv[1])
operation=sys.argv[2]

#b=int(sys.argv[3])
b=float(sys.argv[3])

if operation == "add":
output = add(a,b)
print(output)

if operation == "sub":
output = sub(a,b)
print(output)

if operation == "mul":
output = mul(a,b)
print(output)