Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
64 commits
Select commit Hold shift + click to select a range
dbc2745
Adding the group norms
reunicorn1 Dec 24, 2024
27e286a
fixing the linting issues
reunicorn1 Dec 24, 2024
7d9d053
Merge pull request #1 from MIT-Emerging-Talent/creating-gorup-norms
Omnia-Agabani Dec 24, 2024
32db1c4
fix the collaboration Readme file
Mohamedmxz Dec 24, 2024
623a574
Merge pull request #2 from MIT-Emerging-Talent/creating-gorup-norms
reunicorn1 Dec 24, 2024
81f26fe
Merge branch 'main' of https://github.com/MIT-Emerging-Talent/ET6-pra…
reunicorn1 Dec 29, 2024
3da9d0a
Adding the learning goals
Goutbi Dec 30, 2024
e4f3e80
Adding the Constraints
Goutbi Dec 30, 2024
5e312da
Adding the empty python file
Goutbi Dec 30, 2024
f09f7dc
Adding the Python file
Goutbi Dec 30, 2024
43918ea
adding empty python files
Goutbi Dec 30, 2024
1b290f0
created the file for the arithmetic sequence test
Mayar-Agab Dec 30, 2024
75747e4
I added the test file test_even_number_count.py
Mayar-Agab Dec 30, 2024
a92c007
Merge pull request #10 from MIT-Emerging-Talent/learning-goals
reunicorn1 Dec 30, 2024
509a789
Quadratic Sequence File
Omnia-Agabani Dec 30, 2024
b7c55a7
Create harmonic_sequence file
Omnia-Agabani Dec 30, 2024
4807364
Merge pull request #11 from MIT-Emerging-Talent/constraints
Omnia-Agabani Dec 30, 2024
6e5731e
Delete files error
Omnia-Agabani Dec 31, 2024
5d229b0
Added the test file and the python file for even_number_count
Mayar-Agab Dec 31, 2024
05ce776
Resolved some errors
Mayar-Agab Dec 31, 2024
e283b78
adding the code without the tests
Goutbi Dec 31, 2024
8014440
made changes on tests
Mayar-Agab Dec 31, 2024
2bc4f49
Added defensive cases
Mayar-Agab Dec 31, 2024
01ceeee
unittest added
Goutbi Jan 1, 2025
88ec718
added unittests and comments
Goutbi Jan 1, 2025
4639732
Merge branch 'MIT-Emerging-Talent:main' into Fuel-Gauge
Goutbi Jan 1, 2025
bb20e8a
Merge pull request #39 from MIT-Emerging-Talent/Fuel-Gauge
Goutbi Jan 1, 2025
c75eb4a
added edge case
Mayar-Agab Jan 1, 2025
d45dd4b
Merge branch 'MIT-Emerging-Talent:main' into arithmetic_sequence
Mayar-Agab Jan 1, 2025
9ab033b
FooBar code
RafaaAli Jan 1, 2025
5d5e16f
Extre changed and CI checks
Mayar-Agab Jan 1, 2025
6d77720
changed documentation
Mayar-Agab Jan 1, 2025
a4427b0
Merge pull request #41 from MIT-Emerging-Talent/arithmetic_sequence
Mayar-Agab Jan 1, 2025
185b279
CI Checks
Mayar-Agab Jan 1, 2025
97fe595
Merge branch 'MIT-Emerging-Talent:main' into even_number_count
Mayar-Agab Jan 1, 2025
5bd9e00
added
Mayar-Agab Jan 1, 2025
b75c05a
extended example
Mayar-Agab Jan 1, 2025
88d5ce9
Merge pull request #44 from MIT-Emerging-Talent/arithmetic_sequence
Safi222 Jan 1, 2025
b86f066
modified code and added doctests
Goutbi Jan 2, 2025
6ed6091
Merge branch 'Fuel-Gauge' of https://github.com/MIT-Emerging-Talent/E…
Goutbi Jan 2, 2025
7729789
modified code and added doctests
Goutbi Jan 2, 2025
f7b3359
Merge branch 'Fuel-Gauge' of https://github.com/MIT-Emerging-Talent/E…
Goutbi Jan 2, 2025
4abd3c1
Merge branch 'main' into Fuel-Gauge
Goutbi Jan 2, 2025
e2463be
Merge pull request #46 from MIT-Emerging-Talent/Fuel-Gauge
Goutbi Jan 2, 2025
88712dd
modified the code and added doctests
Goutbi Jan 2, 2025
d0cbd01
pulling the main Merge branch 'Fuel-Gauge' of https://github.com/MIT-…
Goutbi Jan 2, 2025
2fb77a0
modified the code
Goutbi Jan 2, 2025
60aafa6
resolving python formatting -1
Goutbi Jan 2, 2025
6f5f69e
fixing pyformatting -2
Goutbi Jan 2, 2025
f27bfb7
tests have been added
RafaaAli Jan 2, 2025
bb6b72a
docstring has been added
RafaaAli Jan 2, 2025
24df055
Merge pull request #47 from MIT-Emerging-Talent/Fuel-Gauge
reunicorn1 Jan 3, 2025
fc460ef
Merge pull request #43 from MIT-Emerging-Talent/even_number_count
reunicorn1 Jan 3, 2025
ebc09b7
Adding the armstrong checker
Goutbi Jan 4, 2025
55746c1
adding comments to describe the code functions
Goutbi Jan 4, 2025
1629b0b
Merging Main repo updates to repo of group 27
reunicorn1 Jan 4, 2025
cc61420
Merge pull request #57 from MIT-Emerging-Talent/Armstrong_Number
Mayar-Agab Jan 4, 2025
62a781a
fixing importing issues
RafaaAli Jan 4, 2025
32be9d9
fixing more issues
RafaaAli Jan 4, 2025
d0503fc
delete extra files
RafaaAli Jan 5, 2025
1886a9f
solving ruff issues
RafaaAli Jan 5, 2025
7329b59
docstring editing
RafaaAli Jan 6, 2025
63528c8
Merge branch 'main' into count_character
reunicorn1 Jan 7, 2025
5cbcb66
adding enhancment
RafaaAli Jan 12, 2025
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
7 changes: 5 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
//-------- Editor configuration --------

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

// Format a file on save. A formatter must be available.
"editor.formatOnSave": true,
Expand Down Expand Up @@ -122,5 +122,8 @@
"source.fixAll.ruff": "explicit",
"source.organizeImports.ruff": "explicit"
}
}
},
"cSpell.words": [
"Mayar"
]
}
35 changes: 35 additions & 0 deletions collaboration/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,40 @@
# Collaboration

<!-- group norms summary -->
## The summary

Our group is committed to fostering trust, collaboration, and open communication
by valuing diverse perspectives, respecting
time, and embracing accountability. We aim to create a positive and inclusive
environment where everyone feels supported, empowered to contribute, and aligned
toward shared goals. We strive to build strong relationships and ensure
collective growth where mistakes are treated as learning opportunities, and
trust is rebuilt through consistent actions and open dialogue. Together, we
are dedicated to making this a meaningful and enjoyable experience for all.

<!-- group norms list -->
## The list

1. Build and Sustain Trust: Commit to creating a reliable and supportive
environment where trust
underpins all interactions.
2. Foster Open Communication: Ensure a culture where all voices are valued, and
ideas, concerns,
and feedback are openly shared.
3. Respect Time and Focus: Honor each other’s time by striving for purposeful
and efficient
communication and collaboration.
4. Promote Team Growth: Support collective learning, personal development, and
the achievement
of shared goals.
5. Encourage Inclusivity: Create a space where diverse perspectives are
welcomed and everyone
feels empowered to contribute.
6. Ensure Clarity and Alignment: Maintain shared understanding and alignment on
goals, expectations,
and progress.
7. Cultivate a Positive Team Culture: Build a collaborative and motivating
environment that values
both achievements and relationships.
8. Embrace Growth from Challenges: Approach mistakes and challenges as
opportunities for learning and improvement.
95 changes: 63 additions & 32 deletions collaboration/constraints.md
Original file line number Diff line number Diff line change
@@ -1,34 +1,65 @@
<!-- 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
- ...
-->

## 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
-->

## 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
-->
# Constraints

This document outlines the constraints for our collaborative project, helping us
focus on realistic goals and effective teamwork. Each member will solve two
problems by writing Python code, documenting it, and testing it. Additionally,
every member will review two problems written by others. The repository is a
group effort, reflecting everyone's contributions.

## 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 by **January 10**, with
internal deadlines for milestones ensuring consistent progress.
- **Technologies**: The project requires Python, GitHub, VSCode, and linting
tools for coding, collaboration, and quality assurance.
- **Time Constraints**: Members have limited availability due to full-time jobs
and university schedules.

## 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 a mix of beginner and experienced
skill levels, with most members new to coding.
- **Time Availability**: Each member can dedicate only a few hours per week due
to other commitments.

## 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
-->

- **Problem Solving**: Each member will solve two problems by writing Python
code, ensuring the solutions are well-documented and thoroughly tested.
- **Code Reviews**: Every member will review two problems written by others,
providing constructive feedback to enhance quality and learning.
- **Coding Conventions**: The team has agreed on consistent coding styles and a
code review checklist to maintain clarity and quality in the repository.
- **Repository Collaboration**: All members will contribute to a shared GitHub
repository, promoting teamwork and collective ownership of the project.
- **Scope Management**: Realistic project goals have been set to balance
learning opportunities with completing a high-quality final product.
- **Tools Commitment**: The team will use GitHub for version control, VSCode for
development, and Python linting tools to ensure clean, efficient code.
- **Feedback Cycles**: A process for iterative feedback and reviews has been
established to improve both individual skills and project outcomes.
43 changes: 40 additions & 3 deletions collaboration/learning_goals.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,42 @@
# Learning Goals
# Learning Goals

## Collective
Our team comprises ten members with diverse backgrounds, including those new to
coding and others with significant experience. This variety presents an excellent
opportunity for mutual learning and growth. Below are the learning goals we have
collectively identified for these exercises:

## Individual
## Objectives for Team Members New to Coding

- **Build foundational knowledge**: Understand the basics of data structures (DSs)
and algorithms.
- **Learn programming best practices**: Focus on writing clean, readable, and well-
documented code.
- **Practice problem-solving**: Develop confidence in tackling coding problems
step by step.
- **Gain exposure to code review**: Learn how to give and receive constructive feedback
to improve solutions.

## Objectives for Experienced Team Members

- **Strengthen advanced skills**: Dive deeper into complex DSs and algorithms to
enhance problem-solving capabilities.
- **Experiment with new approaches**: Explore and apply new programming language
features to refine solutions.
- **Focus on optimization**: Work on producing efficient and scalable code.
- **Mentor and collaborate**: Guide less experienced team members to create an
inclusive and supportive learning environment.

## Shared Team Objectives

- **Learn through collaboration**: Share knowledge and perspectives to maximize
learning outcomes for everyone.
- **Improve development speed**: Practice writing solutions faster while maintaining
quality.
- **Foster a culture of feedback**: Embrace multiple cycles of review to improve
individual and team skills.
- **Document solutions effectively**: Ensure every solution is well-commented and
easy to understand for future reference.

These goals reflect our commitment to leveraging our diverse skills and experiences
to grow together as a team. We’ll revisit and refine these objectives as needed
to ensure alignment with our progress and expectations.
1 change: 0 additions & 1 deletion solutions/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@

53 changes: 53 additions & 0 deletions solutions/arithmetic_sequence.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
A module for generating a sequence for arithmetic numbers

Module contents:
- arithmetic_sequence:generating a sequence of n arithmetic numbers.

Created on Sunday/22/December/2024
@author:Mayar Ali
"""

# ---before documenting and testing---


def arithmetic_sequence(sequence_length: int) -> list:
"""
list in which the difference between consecutive terms is constant.
Parameters:
sequence_length:int, greater than zero

Returns -list[int] with the first n number of the arithmetic sequence

Raises:
AssertionError : if the argument is not an integer
AssertionError : if the argument is less or equal to zero

Examples:
>>>arithmetic_sequence(0)
[1]
>>>arithmetic_sequence(5)
[0 ,1 ,5 ,9 ,13]
>>>arithmetic_sequence(11)
[0 ,1 ,5 ,9 ,13 ,17 ,21 ,25 ,29 ,33 ,37 ]
"""
assert isinstance(sequence_length, int)
assert sequence_length >= 0

if sequence_length == 0:
return []
if sequence_length == 1:
return [1]
if sequence_length == 2:
return [0, 1]
sequence = [0, 1]
while len(sequence) < sequence_length:
sequence.append(sequence[-1] + 3)

return sequence


if __name__ == "__main__":
print(arithmetic_sequence(20))
42 changes: 42 additions & 0 deletions solutions/armstrong_checker.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
"""Module checks if a number is an Armstrong number."""


def armstrong_checker(number: int) -> str:
"""
Checks if a given positive integer is an Armstrong number.

Parameters:
number (int): The number to check (must be > 0).

Returns:
str:
- "True" if the number is an Armstrong number.
- "False" if the number is not an Armstrong number.
- "Invalid input" for invalid inputs.

Raises:
AssertionError: If the input is not a positive integer.

Examples:
>>> armstrong_checker(153)
'True'
>>> armstrong_checker(123)
'False'
>>> armstrong_checker(-153)
'Invalid input'
"""
if not isinstance(number, int) or number < 0:
return "Invalid input"

# Calculate the sum of the nth power of each digit in the number.
digits = [int(d) for d in str(number)]
# digits puts each digit in the number into a list

n = len(digits)
# n is the number of digits in the number by using the len() function

armstrong_sum = sum(d**n for d in digits)
# armstrong_sum is the sum of the nth power of each digit in the number

return "True" if armstrong_sum == number else "False"
# if the sum of the nth power of each digit in the number is equal to the number, return "True", otherwise return "False"
69 changes: 69 additions & 0 deletions solutions/count_characters.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
#!/usr/bin/env python3
# -- coding: utf-8 --
"""
Creates a function that counts the number of vowels (a, e, i, o, u) in a given string.
The function is case-insensitive, meaning both uppercase and lowercase vowels are counted.

Author: Rafaa Ali
Created date: 3.1.2025
"""


def count_characters(string: str) -> int:
"""This function, `count_vowels`, counts the number of vowels in a given string,
ignoring case sensitivity.

Parameters:
string (str): The input string to count vowels characters

Returns:
int: The total number of vowels in the string

assertion:
string must be string type otherwise error

example:
Edge cases:
>>> count_characters("")
0
>>> count_characters("krm")
0
>>> count_characters(" ")
0

Standard cases:
>>> count_characters lowercase("hello")
2
>>> count_characters uppercase("RAFF")
1
>>>count_characters mixed case("aEiOu")
5

Defensive cases:
>>> count_characters(123)
AssertionError: Input must be string
>>>count_characters(["hello"])
AssertionError: Input must be string
>>> count_characters(None)
AssertionError: Input must be string
"""
# assert an error when input is not string
assert isinstance(string, str), "Input must be string"

# Convert string to lowercase for case-insensitive counting
string = string.lower()

# Define vowels to check against
vowels = "aeiou"

# Initialize counter for vowels
count = 0

# Loop through each character in the string
for char in string:
# If character is a vowel, increment counter
if char in vowels:
count += 1

# Return the total count of vowels
return count
Loading