From cb342e41c7bf0be1d8292b20ab054aa7ba5e61cb Mon Sep 17 00:00:00 2001 From: RINKI NAG Date: Thu, 1 Oct 2020 20:09:20 +0530 Subject: [PATCH 1/2] Create calculator.py --- EAGLEWARRIOR/calculator.py | 49 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 EAGLEWARRIOR/calculator.py diff --git a/EAGLEWARRIOR/calculator.py b/EAGLEWARRIOR/calculator.py new file mode 100644 index 0000000..1ec48ba --- /dev/null +++ b/EAGLEWARRIOR/calculator.py @@ -0,0 +1,49 @@ +class Simple_arthimetic_Operation: + def __init__(self,num1,num2): + self.num1=num1 + self.num2=num2 + + def add(self): + print(self.num1 + self.num2) + + + def sub(self): + print(self.num1 - self.num2) + + + def mul(self): + print(self.num1 * self.num2) + + + def div(self): + print(self.num1 / self.num2) + + def mod(self): + print(self.num1 % self.num2) + + def expo(self): + print(self.num1 ** self.num2) + + def floor(self): + print(self.num1 // self.num2) + +if __name__=='__main__': + a = float(input("Enter the first number")) + b = float(input("Enter the second number ")) + op = input("Enter the arthemetic operation you want to perform ") + calculator=Simple_arthimetic_Operation(a,b) + if op == "+": + calculator.add() + elif op == "-": + calculator.sub() + elif op == "*": + calculator.mul() + elif op == "/": + calculator.div() + elif op=="%": + calculator.mod() + elif op=="**": + calculator.expo() + elif op=="//": + calculator.floor() + From d40d34328561ae8bac5a9c904c0f3880572aec2a Mon Sep 17 00:00:00 2001 From: RINKI NAG Date: Thu, 1 Oct 2020 20:23:21 +0530 Subject: [PATCH 2/2] Create anagram.py --- EAGLEWARRIOR/anagram.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 EAGLEWARRIOR/anagram.py diff --git a/EAGLEWARRIOR/anagram.py b/EAGLEWARRIOR/anagram.py new file mode 100644 index 0000000..1cd2506 --- /dev/null +++ b/EAGLEWARRIOR/anagram.py @@ -0,0 +1,16 @@ +class check_anagram: + def __init__(self,s1,s2): + self.s1=s1 + self.s2=s2 + def check(self): + # the sorted strings are checked + if(sorted(self.s1)== sorted(self.s2)): + print("The strings are anagrams.") + else: + print("The strings aren't anagrams.") +if __name__=='__main__': + # driver code + s1 =input("Enter the first string") + s2 =input("Enter the first string") + c_anangram=check_anagram(s1,s2) + c_anangram.check()