diff --git a/Day-05/task SYS and OS b/Day-05/task SYS and OS new file mode 100644 index 00000000..13dd3e07 --- /dev/null +++ b/Day-05/task SYS and OS @@ -0,0 +1,39 @@ +import sys +import os +def add(num1,num2): + return(num1+num2) + +def sub(num1,num2): + if(num1>num2): + return(num1-num2) + else: + return(num2-num1) +def mult(num1,num2): + return(num1*num2) +def div(num1,num2): + if(num2==0): + print("Division by zero error!") + else: + return(num1/num2) +num1=float(sys.argv[1]) +oper=str(sys.argv[2]) +num2=float(sys.argv[3]) +print(num1,oper,num2) + +if(oper=="+"): + res=add(num1,num2) + print("Addition of two number: ",res) +elif(oper=="-"): + res=sub(num1,num2) + print("Subtraction of two number: ",res) +elif(oper=="x"): + res=mult(num1,num2) + print("Multiplication of two number: ",res) +elif(oper=="/"): + res=div(num1,num2) + print("Division of two number: ",res) +else: + print("You have enter wrong input") + +for key in os.environ: + print(key,"->",os.environ[key]) diff --git a/README.md b/README.md index 23ecf82a..1b9e27e9 100644 --- a/README.md +++ b/README.md @@ -57,8 +57,7 @@ - Example: Automating a log file analysis with a loop to find errors. ## Day 10: Working with Lists (Part 2) -- List comprehensions. -- Nested lists and advanced list operations. +- Advanced list operations. - Practice exercises and examples: - Example: Print list of files in the list of folders provided