forked from MIT-Emerging-Talent/ET6-practice-code-review
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into update-general-README
- Loading branch information
Showing
9 changed files
with
166 additions
and
93 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,40 @@ | ||
<!-- this template is for inspiration, feel free to change it however you like! --> | ||
|
||
# Constraints | ||
|
||
Some boundaries around our project. | ||
|
||
## External | ||
|
||
<!-- | ||
constraints coming from the outside that your team has no control over: | ||
- project deadlines | ||
- number of unit tests required to pass a code review | ||
- technologies (sometimes a client will tell you what to use) | ||
- power or connectivity | ||
- ... | ||
--> | ||
- **Project Deadlines**: The project must be completed and delivered by | ||
**January 8th**. Extensions are not an option. | ||
- **Technology Requirements**: We are required to use specific technologies such | ||
as VS Code, Python, and GitHub. | ||
- **Testing Standards**: All code must pass a minimum of 90% unit test coverage | ||
and meet quality metrics defined by MIT Emerging Talent Foundations Track instructors. | ||
- **Connectivity**: Some team members might face intermittent internet connectivity. | ||
|
||
## Internal: Involuntary | ||
|
||
<!-- | ||
constraints that come from within your team, and you have no control over: | ||
- each of your individual skill levels | ||
- amount of time available to work on the project | ||
--> | ||
- **Skill Levels**: The team includes members with varying levels of expertise, | ||
with some being beginners who are still learning the required tools and technologies. | ||
- **Time Availability**: Team members have varying schedules and commitments, | ||
which can impact how much time each person can contribute. | ||
- **Learning Curve**: Beginners may require additional time to learn new tools, | ||
frameworks, or workflows, potentially slowing progress. | ||
|
||
## Internal: Voluntary | ||
|
||
<!-- | ||
constraints that your team decided on to help scope the project. they may include: | ||
- coding style & conventions | ||
- agree on a code review checklist for the project repository | ||
- the number of hours you want to spend working | ||
- only using the colors black and white | ||
--> | ||
- **Independent Work**: Each team member works independently on their assigned | ||
tasks but can seek advice or guidance from others as needed. | ||
- **Coding Standards**: The team has agreed to follow a consistent coding style | ||
guide to maintain quality and readability. | ||
- **Code Reviews**: All pull requests will be reviewed by at least two other | ||
team members to ensure quality and foster knowledge sharing. | ||
- **Collaboration Tools**: Communication tools like Slack will be used for quick | ||
questions and advice, while GitHub Discussions and Issues will handle more | ||
structured feedback. | ||
- **Documentation**: Clear and beginner-friendly comments and documentation are | ||
mandatory for all code to make it accessible to everyone on the team. | ||
- **Scope Management**: To ensure progress, the project scope is limited to core | ||
features. | ||
- **Flexibility**: Pioneers United encourages flexibility, allowing members to | ||
ask for help or advice at any point without hesitation. |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Challenge: SpongeCase | ||
|
||
## Description | ||
|
||
SpongeCase is a style of text where letters alternately appear | ||
in lower and upper case. | ||
For example, the word in spongeCase would be `sPoNgEcAsE`. | ||
|
||
Write a function that converts the given string into spongeCase. | ||
|
||
## Example | ||
|
||
```python | ||
spongecase("hello world") | ||
# Output: "hElLo wOrLd" | ||
|
||
spongecase("Python") | ||
# Output: "pYtHoN" | ||
|
||
- Challenge Link: [GitHub Issue](https://github.com/MIT-Emerging-Talent/ET6-foundations-group-04/issues/2) |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#!/usr/bin/env python3 | ||
# -*- coding: utf-8 -*- | ||
""" | ||
A module for converting strings into SpongeCase (alternating lower and upper case). | ||
Module contents: | ||
- spongecase: Converts a string into SpongeCase | ||
Created on 28/12/2024 | ||
Author: Chrismy Leprince Paul Augustin | ||
""" | ||
|
||
|
||
def spongecase(text: str) -> str: | ||
"""Converts a string into SpongeCase, where letters alternate between lower | ||
and upper case, starting with lower case. | ||
Parameters: | ||
text: str, a string to be converted into SpongeCase | ||
Returns -> str: The SpongeCase version of the input string | ||
Examples: | ||
>>> spongecase("hello world") | ||
'hElLo wOrLd' | ||
>>> spongecase("PYTHON") | ||
'pYtHoN' | ||
>>> spongecase("HELLO!") | ||
'hElLo!' | ||
""" | ||
result_chars = [] | ||
for index, char in enumerate(text): | ||
if index % 2 == 0: | ||
# Even index -> lowercase | ||
result_chars.append(char.lower()) | ||
else: | ||
# Odd index -> uppercase | ||
result_chars.append(char.upper()) | ||
return "".join(result_chars) |
This file was deleted.
Oops, something went wrong.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
#!/usr/bin/env python3 | ||
# -*- coding: utf-8 -*- | ||
""" | ||
Test module for spongecase function. | ||
Test categories: | ||
- Basic cases: typical strings, single words | ||
- Edge cases: empty string, all uppercase, all lowercase | ||
- Special characters: punctuation, digits, symbols | ||
Created on 2024-12-28 | ||
Author: Chrismy Leprince Paul Augustin | ||
""" | ||
|
||
import unittest | ||
|
||
from solutions.challenge_2.spongecase import spongecase | ||
|
||
|
||
class TestSpongeCase(unittest.TestCase): | ||
"""Test suite for the spongecase function.""" | ||
|
||
def test_spongecase_basic(self): | ||
""" | ||
It should convert a typical string containing spaces into SpongeCase. | ||
Example: | ||
"hello world" -> "hElLo wOrLd" | ||
""" | ||
self.assertEqual(spongecase("hello world"), "hElLo wOrLd") | ||
|
||
def test_spongecase_single_word(self): | ||
""" | ||
It should convert a single word into SpongeCase. | ||
Example: | ||
"Python" -> "pYtHoN" | ||
""" | ||
self.assertEqual(spongecase("Python"), "pYtHoN") | ||
|
||
def test_spongecase_empty_string(self): | ||
""" | ||
It should handle an empty string by returning an empty string. | ||
Example: | ||
"" -> "" | ||
""" | ||
self.assertEqual(spongecase(""), "") | ||
|
||
def test_spongecase_all_caps(self): | ||
""" | ||
It should convert an all-caps string into SpongeCase. | ||
Example: | ||
"HELLO" -> "hElLo" | ||
""" | ||
self.assertEqual(spongecase("HELLO"), "hElLo") | ||
|
||
def test_spongecase_all_lowercase(self): | ||
""" | ||
It should convert an all-lowercase string into SpongeCase. | ||
Example: | ||
"world" -> "wOrLd" | ||
""" | ||
self.assertEqual(spongecase("world"), "wOrLd") | ||
|
||
def test_spongecase_special_characters(self): | ||
""" | ||
It should alternate case while preserving special characters | ||
and digits in place. | ||
Mapping indices: | ||
Index: 0 1 2 3 4 5 6 7 8 9 | ||
Char: H e l l o ? 1 # A b | ||
Case: h E l L o ? 1 # a B | ||
Result: "hElLo?1#aB" | ||
""" | ||
self.assertEqual(spongecase("Hello?1#Ab"), "hElLo?1#aB") |
This file was deleted.
Oops, something went wrong.