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
27 changes: 0 additions & 27 deletions README.md

This file was deleted.

20 changes: 20 additions & 0 deletions lab_fun.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
def separate_capitals(text):
"""
This function checks if the parameter is a string.
Then it separates words at capital letters,
converts them to lowercase,
and returns the modified string.
"""

if not isinstance(text, str):
return "Error: Parameter must be a string"

result = ""

for char in text:
if char.isupper():
result += " " + char.lower()
else:
result += char

return result.strip()
20 changes: 20 additions & 0 deletions lab_fun.py ponus
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
def separate_capitals(text):
"""
This function checks if the parameter is a string.
Then it separates words at capital letters,
converts them to lowercase,
and returns the modified string.
"""

if not isinstance(text, str):
return "Error: Parameter must be a string"

result = ""

for char in text:
if char.isupper():
result += " " + char.lower()
else:
result += char

return result.strip()