From 4a95719d58a708ad55b1389631d6339047f786a0 Mon Sep 17 00:00:00 2001 From: standenboy Date: Fri, 15 Dec 2023 10:19:20 +0000 Subject: added existing work --- comp/work/11/area.py | 7 +++++++ comp/work/11/cinlinder.py | 6 ++++++ comp/work/11/isLetter.py | 7 +++++++ comp/work/11/numOfVowles.py | 8 ++++++++ comp/work/11/volume.py | 5 +++++ comp/work/11/wage.py | 10 ++++++++++ 6 files changed, 43 insertions(+) create mode 100755 comp/work/11/area.py create mode 100755 comp/work/11/cinlinder.py create mode 100755 comp/work/11/isLetter.py create mode 100755 comp/work/11/numOfVowles.py create mode 100755 comp/work/11/volume.py create mode 100755 comp/work/11/wage.py (limited to 'comp/work/11') diff --git a/comp/work/11/area.py b/comp/work/11/area.py new file mode 100755 index 0000000..c4e2359 --- /dev/null +++ b/comp/work/11/area.py @@ -0,0 +1,7 @@ +def area(length, height): + return length * height + +length = int(input("the length of the shape: ")) +height = int(input("the height of the shape: ")) + +print(area(length,height)) diff --git a/comp/work/11/cinlinder.py b/comp/work/11/cinlinder.py new file mode 100755 index 0000000..3fc1972 --- /dev/null +++ b/comp/work/11/cinlinder.py @@ -0,0 +1,6 @@ +import math + +def volume(height, radius): + return ((math.pi * radius**2) * height) + +print(volume(10, 3)) diff --git a/comp/work/11/isLetter.py b/comp/work/11/isLetter.py new file mode 100755 index 0000000..593ff5e --- /dev/null +++ b/comp/work/11/isLetter.py @@ -0,0 +1,7 @@ +import string +def isLetter(letter): + for i in list(string.ascii_lowercase): + if letter == i: + return True + return False +print(isLetter('1')) diff --git a/comp/work/11/numOfVowles.py b/comp/work/11/numOfVowles.py new file mode 100755 index 0000000..77ab199 --- /dev/null +++ b/comp/work/11/numOfVowles.py @@ -0,0 +1,8 @@ +def count(string): + counter = 0 + for i in string.lower(): + for j in ["a","e","i","o","u"]: + if i == j: + counter = counter + 1 + return counter +print(count("hello")) diff --git a/comp/work/11/volume.py b/comp/work/11/volume.py new file mode 100755 index 0000000..3963b4a --- /dev/null +++ b/comp/work/11/volume.py @@ -0,0 +1,5 @@ +def volume(x,y,z): + return x*y*z + + +print(volume(5,6,3)) diff --git a/comp/work/11/wage.py b/comp/work/11/wage.py new file mode 100755 index 0000000..4dbba7f --- /dev/null +++ b/comp/work/11/wage.py @@ -0,0 +1,10 @@ +def wage(hours, rate): + pay = 0 + for i in range(hours): + if i < 35: + pay = pay + rate + else: + pay = pay + (rate + (rate * 0.5)) + return pay + +print(wage(40, 10)) -- cgit v1.2.3