From 4ac07e4790d0a9109da4dd01840a9d84a161590d Mon Sep 17 00:00:00 2001 From: "aayanagarwal05@gmail.com" <49789627+aayan05@users.noreply.github.com> Date: Thu, 1 Oct 2020 21:06:39 +0530 Subject: [PATCH 1/2] 2d-Calc --- .idea/.gitignore | 8 ++++ .idea/Python-1.iml | 8 ++++ .../inspectionProfiles/profiles_settings.xml | 6 +++ .idea/misc.xml | 4 ++ .idea/modules.xml | 8 ++++ .idea/vcs.xml | 6 +++ ion05/2d-calc.py | 37 +++++++++++++++++++ 7 files changed, 77 insertions(+) create mode 100644 .idea/.gitignore create mode 100644 .idea/Python-1.iml create mode 100644 .idea/inspectionProfiles/profiles_settings.xml create mode 100644 .idea/misc.xml create mode 100644 .idea/modules.xml create mode 100644 .idea/vcs.xml create mode 100644 ion05/2d-calc.py diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..9feb478 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,8 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Datasource local storage ignored files +/../../../../../../:\Aayan\Tech\Hacktoberfest\Python-1\.idea/dataSources/ +/dataSources.local.xml +# Editor-based HTTP Client requests +/httpRequests/ diff --git a/.idea/Python-1.iml b/.idea/Python-1.iml new file mode 100644 index 0000000..d0876a7 --- /dev/null +++ b/.idea/Python-1.iml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/inspectionProfiles/profiles_settings.xml b/.idea/inspectionProfiles/profiles_settings.xml new file mode 100644 index 0000000..105ce2d --- /dev/null +++ b/.idea/inspectionProfiles/profiles_settings.xml @@ -0,0 +1,6 @@ + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..8161a60 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..17a54df --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/ion05/2d-calc.py b/ion05/2d-calc.py new file mode 100644 index 0000000..2cc520f --- /dev/null +++ b/ion05/2d-calc.py @@ -0,0 +1,37 @@ +import math +fig = input("For which figure do you want to calculate ?") +pie = 22/7 +if fig == "Square": + no1 = float(input("Enter the length of the side ")) + type = input("What do you want to calculate ?") + if type == "Area": + print(no1**2) + elif type =='Perimeter': + print(4*no1) + else: + print("Invalid Type") +if fig == "Rectangle": + l = float(input("Enter the length")) + w = float(input("Enter the width")) + type = input("What do you want to calculate ?") + if type == "Area": + print(l*w) + elif type == "Perimeter": + print(2*(l+w)) + else: + print("Invalid Type") +if fig == "Triangle": + b = float(input("Enter the length of the base")) + h = float(input("Enter the height")) + a = (b*h)/2 + print("The area is ",a) +if fig == "Circle": + r = float(input("Enter the radius of the circle")) + type = input("What do you want to calculate") + if type == "Area": + print(pie*(r**2)) + elif type == "Circumference": + print(2*pie*r) + else: + print("Invalid Type") + From 1f2e1fbdc863a5fa3b4753b11d12cfefdad124d5 Mon Sep 17 00:00:00 2001 From: "aayanagarwal05@gmail.com" <49789627+aayan05@users.noreply.github.com> Date: Thu, 1 Oct 2020 21:11:09 +0530 Subject: [PATCH 2/2] 3D calc --- ion05/3d-calc.py | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 ion05/3d-calc.py diff --git a/ion05/3d-calc.py b/ion05/3d-calc.py new file mode 100644 index 0000000..9d2f06c --- /dev/null +++ b/ion05/3d-calc.py @@ -0,0 +1,39 @@ +import math +pie = 22/7 +fig = input("For which figure do you want to calculate ?") +if fig == "Cube": + s = float(input("Enter the length of the side")) + type = input("What do you want to calculate") + if type == "LSA": + print(4*s*s) + elif type == "TSA": + print(6*s*s) + elif type == "Volume": + print(s**3) + else: + print("Invalid Type") +elif fig == "Cuboid": + l = float(input("Enter the Length")) + w = float(input("Enter the width")) + h = float(input("Enter the Height")) + type = input("What do you want to c") + if type == "LSA": + a = 2((h*w)+(h*l)) + print(a) + elif type == "TSA": + print(2((h*w)+(h*l)+(l*w))) + elif type == "Volume": + print(l*w*h) + else: + print("Invalid Type") +elif fig == "Sphere": + r = float(input("Enter the radius")) + type = input("What do you want to calculate ?") + if type == "TSA": + print(4*pie*r*r) + elif type == "Volume": + print((4*pie*r*r*r)/3) + else: + print("Invalid Type") + +