Skip to content

Commit

Permalink
Merge branch 'main' into finding_maximum_minimum
Browse files Browse the repository at this point in the history
  • Loading branch information
YonatanBest authored Jan 4, 2025
2 parents 8976b4a + aa6adae commit b5b09f2
Show file tree
Hide file tree
Showing 18 changed files with 853 additions and 79 deletions.
21 changes: 10 additions & 11 deletions .github/workflows/ci-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,19 @@ on: [push, pull_request, workflow_dispatch]

jobs:
ls_linting:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ls-lint/[email protected]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ls-lint/[email protected]

md_formatting:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: nosborn/[email protected]
with:
files: .
config_file: .markdownlint.yml
- uses: actions/checkout@v4
- uses: nosborn/[email protected]
with:
files: .
config_file: .markdownlint.yml

py_formatting:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -44,7 +44,7 @@ jobs:
if: always()
- name: install pylint
run: |
python - m pip install --upgrade pip
python -m pip install --upgrade pip
pip install pylint
shell: bash
- name: Python - Check Linting - pylint
Expand All @@ -55,7 +55,6 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: python version
run: python --version
shell: bash
Expand Down
1 change: 1 addition & 0 deletions .markdownlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,4 @@ MD048: # Code block style (consistent backticks)
# Disable some strict rules for beginners
MD024: false # Allow multiple headings with the same content
MD041: false # First line in a file being a top-level heading
MD033: false # allow inline html
85 changes: 23 additions & 62 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,125 +2,86 @@
// https://vscode-docs.readthedocs.io/en/stable/customization/userandworkspace/#default-settings
//-------- Editor configuration --------

// Controls auto save of editors that have unsaved changes.: https://code.visualstudio.com/docs/editor/codebasics#_save-auto-save
"files.autoSave": "onFocusChange",

// Format a file on save. A formatter must be available.
"editor.formatOnSave": true,

// Controls whether the editor should automatically format the pasted content. A formatter must be available.
"editor.formatOnPaste": true,

// Controls whether the editor should render indent quides
"editor.guides.indentation": true,

// Controls whether the editor should highlight the active indent guide.
"editor.guides.highlightActiveIndentation": true,

// Controls the rendering size of tabs in characters. Accepted values: "auto", 2, 4, 6, etc. If set to "auto", the value will be guessed when a file is opened.
"editor.tabSize": 2,

// Defines a default formatter which takes precedence over all other formatter settings. Must be the identifier of an extension contributing a formatter
"editor.defaultFormatter": "esbenp.prettier-vscode",

// Controls bracket pair colorization is enabled or not
"editor.bracketPairColorization.enabled": true,

// Controls whether bracket pair guides are enabled or not. (true, active, false)
"editor.guides.bracketPairs": "active",

// Controls whether horizontal bracket pair guides are enabled or not.
"editor.guides.bracketPairsHorizontal": "active",

// Controls whether the editor should highlight the active bracket pair.
"editor.guides.highlightActiveBracketPair": true,

// Controls whether the editor has linked editing enabled.
"editor.linkedEditing": true,

//-------- HTML configuration --------

// Enable/disable auto closing of HTML tags
"html.autoClosingTags": true,

// Configures if the built-in HTML language suggests HTML5 tags, properties and values.
"html.suggest.html5": true,

// Defines a default HTML formatter which takes precedence over all other formatter settings. Must be the identifier of an extension contributing a formatter
"[html]": {
"editor.defaultFormatter": "vscode.html-language-features"
},

//-------- Emmet configuration --------

// Enables completion when you are writing Emmet appreveation.
"html-css-class-completion.enableEmmetSupport": true,

//-------- JavaScript configuration --------

// Enable/disable auto closing of JSX tags.
"javascript.autoClosingTags": true,

// Enable/disable auto import suggestions.
"javascript.suggest.autoImports": true,

// Enable/disable automatic updating of import paths when you rename or move a file in VS Code.
"javascript.updateImportsOnFileMove.enabled": "always",

// Enable/disable suggestoins for paths in import statement and require calls. (change it to false to be able to use Path Intellisense extension)
"javascript.suggest.paths": false,

//-------- TypeScript configuration --------

// Enable/disable auto closing of JSX tags.
"typescript.autoClosingTags": true,

// Enable/disable auto import suggestions.
"typescript.suggest.autoImports": true,

// Enable/disable automatic updating of import paths when you rename or move a file in VS Code.
"typescript.updateImportsOnFileMove.enabled": "always",

// Enable/disable suggestoins for paths in import statement and require calls. (change it to false to be able to use Path Intellisense extension)
"typescript.suggest.paths": false,

//-------- Work Bench configuration --------

// Controls whether a top border is drawn on tabs for editors that have unsaved changes.
"workbench.editor.highlightModifiedTabs": true,

//-------- Files configuration --------

// When enabled, will trim all new lines after the final new line at the end of the file when saving it.
"files.trimFinalNewlines": true,

// When enabled, insert a new final line at the end of the file when saving it.
"files.insertFinalNewline": true,

//-------- Live Server configuration --------

// Set Custom Port Number of Live Server. Set 0 if you want random port.
"liveServer.settings.port": 5504,

//-------- Markdown configuration --------

// Enable path suggestoins while writing links in markdown files
"markdown.suggest.paths.enabled": true,

// Defines a default markdown formatter which takes precedence over all other formatter settings. Must be the identifier of an extension contributing a formatter
"[markdown]": {
"editor.defaultFormatter": "DavidAnson.vscode-markdownlint"
},

// Enable/disable update table of contents on save
"markdown.extension.toc.updateOnSave": false,

"cSpell.words": [
"Banchiamlak",
"Elnageeb",
"Khayri",
"Khusro",
"Linah",
"Mengsteab",
"Mesfin",
"Robel",
"Sakhi",
"Teka",
"Viktoriya",
"Yifat",
"Yishkl",
"Yonatan",
"Zeinab"
],

"[python]": {
"editor.defaultFormatter": "charliermarsh.ruff",
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.fixAll.ruff": "explicit",
"source.organizeImports.ruff": "explicit"
}
}
},
"cSpell.words": [
"Khayri",
"Linah"
]
}
Empty file added =
Empty file.
57 changes: 57 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
<div align="center">
<img src="https://text.media.giphy.com/v1/media/giphy.gif?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJrZXkiOiJwcm9kLTIwMjAtMDQtMjIiLCJzdHlsZSI6InJhZ2UiLCJ0ZXh0IjoiR3JvdXAlMjAyNCIsImlhdCI6MTczNTIwMzkwMX0.6dBXa0DW7iOQGETxKrxHG39dDYceUY57aFiex_UZ6LM" alt="Demo GIF">
</div>
<!-- MD03/no-inline-html: Inline HTML is used intentionally to center the image for better visual alignment. -->

# This Project is All About Teamwork! 🤝

Together, we dive into coding and testing challenges, sharpening our problem-solving and collaboration skills as a united team. Our mission is to work in harmony, review each others solutions, and grow through shared learning and constructive feedback. We believe that exceptional solutions stem from exceptional teamwork. That's why we are dedicated to building and supporting each other every step of the way. Let's make amazing things happen, together! ⭐

---

## 🚀 Project Overview

### What We will Do

- 🧠 **Coding Challenges**: We will face a variety of coding problems, each offering new learning opportunities.
- 🔍 **Review Each Others Solutions**: After completing tasks, we will give and receive feedback to ensure high-quality results and growth.
- 🛠️ **Collaborate on Testing**: Testing is a key part of the process. We will work together to ensure our solutions are robust and reliable.
- 💬 **Communicate Effectively**: From code discussions to problem-solving, clear and open communication is key to our success.
- 🚧 **Solve Roadblocks Together**: No one is left behind. If a challenge arises, we will come together to brainstorm and troubleshoot.
- 🌱 **Learn and Grow**: The goal is not just to finish the tasks, but to grow as a team through shared knowledge and experiences.

---

## 🌟 How We Collaborate

🧩 We take collaboration seriously. Here is how we do it:

- [Our Norms](https://github.com/MIT-Emerging-Talent/ET6-foundations-group-24/blob/main/collaboration/README.md)
- [Our Communication](https://github.com/MIT-Emerging-Talent/ET6-foundations-group-24/blob/main/collaboration/communication.md)
- [Our Constraints](https://github.com/MIT-Emerging-Talent/ET6-foundations-group-24/blob/main/collaboration/constraints.md)
- [Our Learning Goals](https://github.com/MIT-Emerging-Talent/ET6-foundations-group-24/blob/main/collaboration/learning_goals.md)
- [Our Retrospectives](https://github.com/MIT-Emerging-Talent/ET6-foundations-group-24/blob/main/collaboration/retrospective.md)
- [Our challenges](https://github.com/MIT-Emerging-Talent/ET6-foundations-group-24/tree/main/solutions)

---

## Meet the Dream Team 🧑‍🤝‍🧑

Our squad is made up of some seriously talented people who bring the 🔥 to this project. Check out the crew making it all come to life:

- [**Abel Mesfin Teka**](https://github.com/TekaMesfinAbel)
- [**Banchiamlak Tessema**](https://github.com/BanchiHub)
- [**Gai Samuel**](https://github.com/GaiSamuel)
- [**Khusro Sakhi**](https://github.com/Khusro-S)
- [**Linah Khayri**](https://github.com/linahKhayri)
- [**Mohamed Elnageeb**](https://github.com/Mohamed-Elnageeb)
- [**Robel Mengsteab**](https://github.com/robiel0143)
- [**Viktoriya Haiduk**](https://github.com/ViktoriyaHaiduk)
- [**Yonatan Yishkl Yifat**](https://github.com/YonatanBest)
- [**Zeinab Mohammed**](https://github.com/Zeinab15)

### 💥 Here We Go

With the team all set, we are ready to make some magic happen. Stay with us for the ride, things are about to get awesome! 💪

![Demo GIF](https://media0.giphy.com/media/v1.Y2lkPTc5MGI3NjExOTBrZHhqdG9tNG9sNDd2c2YwdThvaW5qc3d2OHB1ZHJmajN4Z2hweCZlcD12MV9pbnRlcm5hbF9naWZfYnlfaWQmY3Q9Zw/3o85xHhy12MVG2fkVW/giphy.webp)
6 changes: 0 additions & 6 deletions notes/my_first_note.md

This file was deleted.

22 changes: 22 additions & 0 deletions solutions/README.md
Original file line number Diff line number Diff line change
@@ -1 +1,23 @@
# Solutions

Welcome to the **Solutions** directory of Group 24! This folder contains the implementations and solutions to the challenges or problems assigned to the group by its members.

## Directory Structure

- Each task or problem will have its own folder or file, clearly named for easy identification.
- Code solutions are typically written in python.

## Contribution Guidelines

1. Ensure your solution is optimized and well-documented.
2. Follow the coding standards outlined by the team.
3. Include comments in your code to explain key logic.
4. Test your solutions locally before submitting them.

## Status

- We continuously improve and refine our solutions. Please check for updates regularly!

## Contact

For questions or suggestions regarding the solutions, reach out to the team members.
46 changes: 46 additions & 0 deletions solutions/calculate_mean.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
This module provides a function to calculate the mean (average) of a list of numbers.
Date created: Dec 30,2024
Author: @Abel Teka
"""

from typing import List, Optional


def calculate_mean(numbers: List[float]) -> Optional[float]:
"""
Calculate the mean (average) of a list of numbers.
Args:
numbers (List[float]): A list of numbers (integers or floats).
Returns:
Optional[float]: The mean (average) of the numbers in the list.
- Returns None if the list is empty.
- Returns infinity if the sum of the list is infinite.
Raises:
TypeError: If `numbers` is not a list or contains non-numeric elements.
Examples:
>>> calculate_mean([1, 2, 3, 4, 5])
3.0
>>> calculate_mean([10, 20, 30])
20.0
>>> calculate_mean([])
>>> calculate_mean([float('inf'), 1, 2])
inf
"""
if not isinstance(numbers, list):
raise TypeError("Input must be a list.")
if any(not isinstance(n, (int, float)) for n in numbers):
raise TypeError("All elements in the list must be numbers.")

if not numbers:
return None

return sum(numbers) / len(numbers)
40 changes: 40 additions & 0 deletions solutions/check_anagram.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
This module provides a function to check if two strings are anagrams.
Date created: Dec 31, 2024
Author: @Abel Teka
"""


def is_anagram(string1: str, string2: str) -> bool:
"""
Check if two strings are anagrams of each other.
Args:
string1 (str): The first string to compare.
string2 (str): The second string to compare.
Returns:
bool: True if the strings are anagrams, False otherwise.
Raises:
AttributeError: If either argument is not a string.
Examples:
>>> is_anagram("listen", "silent")
True
>>> is_anagram("hello", "world")
False
>>> is_anagram("evil", "vile")
True
"""
if not isinstance(string1, str) or not isinstance(string2, str):
raise AttributeError("Both inputs must be strings.")

# Normalize strings: remove spaces, convert to lowercase, and sort characters
normalized1 = "".join(sorted(string1.replace(" ", "").lower()))
normalized2 = "".join(sorted(string2.replace(" ", "").lower()))

return normalized1 == normalized2
Loading

0 comments on commit b5b09f2

Please sign in to comment.