Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added __pycache__/functions.cpython-313.pyc
Binary file not shown.
28 changes: 28 additions & 0 deletions functions.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import string


def get_unique_list_f(lst):
return list(set(lst))


def count_case_f(string_input):
upper = 0
lower = 0

for char in string_input:
if char.isupper():
upper += 1
elif char.islower():
lower += 1

return upper, lower


def remove_punctuation_f(sentence):
return sentence.translate(str.maketrans('', '', string.punctuation))


def word_count_f(sentence):
cleaned = remove_punctuation_f(sentence)
words = cleaned.split()
return len(words)
Loading