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/5/wordCount.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100755 comp/work/5/wordCount.py (limited to 'comp/work/5/wordCount.py') diff --git a/comp/work/5/wordCount.py b/comp/work/5/wordCount.py new file mode 100755 index 0000000..8674b3f --- /dev/null +++ b/comp/work/5/wordCount.py @@ -0,0 +1,12 @@ +sentence = input("sentence: ") + +cons = 0 +spaces = 0 + +for i in sentence: + if i == ' ': + spaces =+ 1 + + if i != 'a' and i != 'e' and i != 'i' and i != 'o' and i != 'u': + cons = cons + 1 +print("there are", cons - 2, "consinants and", spaces + 2, "words") -- cgit v1.2.3