Skip to content

Commit

Permalink
Merge branch 'main' into contributing_update
Browse files Browse the repository at this point in the history
  • Loading branch information
Mo-Altayeb authored Jan 11, 2025
2 parents ad1ce25 + 9d930ff commit d994148
Show file tree
Hide file tree
Showing 12 changed files with 497 additions and 19 deletions.
10 changes: 6 additions & 4 deletions collaboration/communication.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,22 +29,24 @@ How often we will get in touch on each channel, and what we will discuss there:
| Clement| 6-8 PM | 6-8 PM | 6-8 PM | 6-8 PM | 6-8 PM | 6-8 PM | 6-8 PM |
| Fahed | 6-8 PM | 7-9 PM | 6-8 PM | 5-7 PM | 8-9 PM | 8-9 PM | 6-8 PM |
| Faisal | $TIME$ | $TIME$ | $TIME$ | $TIME$ | $TIME$ | $TIME$ | $TIME$ |
| Majd |6-8 PM | 6-8 PM | 5-6 PM | 4-7 PM | 4-7 PM | 4-7 PM | 7-9 PM |
| Majd | 6-8 PM | 5-6 PM | 7-9 PM | 5-7 PM |7-9 PM | 6-8 PM | 6-8 PM |
| Mohamed| 6-9 PM | 6-9 PM | 6-9 PM | 6-10 PM | 2-9 PM | 6-9 PM | 6-9 PM |
| Obey | 6-9 PM | 6-9 PM | 6-8 PM | 7-9 PM | 2-10 PM| 5-10 PM | 6-9 PM |
| Özgür | $TIME$ | $TIME$ | $TIME$ | $TIME$ | $TIME$ | $TIME$ | $TIME$ |
| Özgür | 5-7 PM | 5-7 PM | 5-7 PM | 5-7 PM | 5-7 PM | 5-7 PM | 5-7 PM |
| Razan | 7-9 PM | 9-10 PM | 7-9 PM | 7-9 PM | 7-9 PM | 7-9 PM | 7-9 PM |


Check failure on line 38 in collaboration/communication.md

View workflow job for this annotation

GitHub Actions / md_formatting

Multiple consecutive blank lines [Expected: 1; Actual: 2]

Check failure on line 38 in collaboration/communication.md

View workflow job for this annotation

GitHub Actions / md_formatting

Multiple consecutive blank lines [Expected: 1; Actual: 2]
### How many hours everyone reserves for Code review per day

- Anas: 2 Hours
- Clement: 1.5 hours
- Fahed: 1 hour
- Faisal: $HOURS$
- Majd: $HOURS$
- Majd: 4 hours
- Mohamed: 2 hours
- Obey: 2 hours
- Özgür: $HOURS$
- Özgür: 2 hours
- Obey: $HOURS$
- Razan: An hour

## Asking for Help
Expand Down
10 changes: 5 additions & 5 deletions collaboration/learning_goals.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,8 @@ environment that provides support and help to every member in need.
- Enhance communication and collaborative skills for a more effective work environment.

- ### **Özgür**

-learning team work.
-Write clean python code.
-Improve communication skills with team members.
-Using unit test.
- learning team work.
- Write clean python code.
- Improve communication skills with team members.
- Using unit test.
26 changes: 26 additions & 0 deletions notes/README.md
Original file line number Diff line number Diff line change
@@ -1 +1,27 @@
# Notes

Welcome to the **Notes** directory! 🎉

This is our little corner of the project where we share all the gems we pick up
along the way. 🧠✨

Here’s what you’ll find (and what you’re welcome to add):

- 🖋️ **What We're Learning:** Got a cool trick in Git? Learned a new design
pattern? Found a clever way to squash bugs? Share it here!
- 😂 **Funny Moments:** Code reviews aren’t always serious — if something made
you laugh (or cry), jot it down! Laughter is the best debugging tool.
- 📚 **Resources:** Found a great article, video, or book that helped you level
up? Share it with the team!
- ❤️ **Personal Reflections:** How’s the journey been for you? Whether it’s
growth, challenges, or proud moments, we’d love to hear about it.
- 🤝 **Collaboration Stories:** Cool ways we’ve helped each other shine or
overcame hurdles as a team.
- 🎨 **Creative Additions:** Doodles, memes, or anything that adds color to our
shared experience!

This space is all about **connection** and **growth**. Use it freely to document
your learning, share your quirks, or just have fun. Let’s make this a treasure
trove of memories and insights! 🚀

Happy noting, team! 📝🌟
9 changes: 9 additions & 0 deletions solutions/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,18 @@ while corresponding test files are maintained in the `tests` folder.
| `grading_system.py`| Assigning letter grade to a numeric score. | Razan |
| `kronecker_product.py` | Computes the Kronecker ⊗ product of 2 matrices | Fahed|
| `feet_to_meters.py` | Converting feet to meters| Obay |
| `area_circle.py`| Calculates the area of the circle | Majd |
| `multiplication.py`| Calculate the multiple of two numbers | Majd|
| `square.py`| Find the number power of two | Majd |
| `volts_to_amperes.py` | Converting volts to amperes| Obay |
| `miles_to_kilometers.py` | Converting miles to kilometers| Obay |
| `greatest_number.py` | Finding greatest number in a list| Razan |
| `common_elements.py` | finding common elements in two lists | Mohamed|
| `simple_calculator.py` | performs simple operations on two integers | Mohamed|
| `reverse_string.py` | reverses contents of an input string | Mohamed|
| `check_prime_number.py` | Given a positive int if it is a prime number| Özgür |
| `password_strength.py` | Checks the strength of a password| Anas |
| `decimal_to_binary.py` | Converts decimal to its equivalent binary| Anas |

---

Expand Down
35 changes: 35 additions & 0 deletions solutions/area_circle.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
"""
Group: ET6-foundations-group-16
Author:Majd Abualsoud
Date: January 11, 2025
This module provides a function to calculate the area of a circle given its radius.
"""

import math


def area_of_circle(radius: float) -> float:
"""
Calculate the area of a circle given its radius.
Args:
radius (float): The radius of the circle. Must be a non-negative number.
Returns:
float: The area of the circle.
Raises:
ValueError: If the radius is negative.
Examples:
>>> area_of_circle(1)
3.141592653589793
>>> area_of_circle(0)
0.0
>>> area_of_circle(2.5)
19.634954084936208
"""
if radius < 0:
raise ValueError("The radius must be a non-negative number.")

return math.pi * radius * radius
45 changes: 45 additions & 0 deletions solutions/check_prime_number.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
#!/usr/bin/env python3
"""
This function check number for prime or not.
Author: Özgür ÖZBEK
Date: 11th January 2025
Group: ET6-foundations-group-16
"""


def check_prime_number(number: int) -> bool:
"""Checks if a number is prime.
A prime number is a number greater than 1 that has no divisors other than 1 and itself.
This function checks if the given number is prime by testing divisibility for all numbers
from 2 to the square root of the number.
Parameters:
number: int, the number to check for prime. Must be greater than 1.
Returns:
bool: True if the number is prime, False otherwise.
Raises:
AssertionError: If the number is less than or equal to 1.
Examples:
>>> check_prime_number(2)
True
>>> check_prime_number(3)
True
>>> check_prime_number(4)
False
>>> check_prime_number(13)
True
>>> check_prime_number(1) # doctest: +ELLIPSIS
Traceback (most recent call last):
...
AssertionError: Number must be greater than 1
"""
assert number > 1, "Number must be greater than 1"
for i in range(2, int(number**0.5) + 1):
if number % i == 0:
return False
return True
59 changes: 59 additions & 0 deletions solutions/common_elements.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
A module for finding the common elements between two input lists.
Created on 11/1/2025
@author: Mohamed Altayeb
Group: ET foundations group 16 (Matrix)
Module functions:
- common_elements: finds the common elements between two lists.
"""


def common_elements(list1: list, list2: list) -> list:
"""
Compares two input lists and returns a list that contains
all the common elements between the two input lists without repeating
the common elements if they are duplicated in the input lists:
Arguments:
list1 (list): the first list we want to compare.
list2 (list): the second list we want to compare.
Returns-> list: A list containing all common elements between two input lists,
the returned list will have the common elements of the first input list
followed by the common elements of the second input list.
Raises:
AssertionError: if inputs are not lists.
>>> common_elements([1,2,3,4,5,6] , [4,5,6,7])
[4, 5, 6]
>>> common_elements(["c", "a", "r"] , ["c", "a", "t"])
['c', 'a']
>>> common_elements([[1,2] , [2,3,4], ["mohamed"]] , [["mohamed"], [1,2,3], [2,3,4], [4,5,6]])
[[2, 3, 4], ['mohamed']]
"""
# Ensure both inputs are lists
if not isinstance(list1, list) or not isinstance(list2, list):
raise AssertionError("Both inputs must be lists")

common_list_no_duplicates = []

# Iterate through elements of the first list
for element1 in list1:
# Iterate through elements of second list comparing
# each element in the second list to the element in the first list
for element2 in list2:
if element1 == element2 and element1 not in common_list_no_duplicates:
# Add the element to the resultant list
common_list_no_duplicates.append(element1)

# Return the resultant list with common elements with no duplicated elements
return common_list_no_duplicates
3 changes: 3 additions & 0 deletions solutions/multiplication.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
#!/usr/bin/env python3
# -- coding: utf-8 --
"""
Group: ET6-foundations-group-16
Author:Majd Abualsoud
Date: January 11, 2025
A module for multiplying two numbers.
Module contents:
- multiply_numbers: Multiplies two numbers and returns the product.
Expand Down
39 changes: 39 additions & 0 deletions solutions/tests/test_area_circle.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
"""
Group: ET6-foundations-group-16
Author:Majd Abualsoud
Date: January 11, 2025
Test suite for the area_of_circle function.
"""

import math
import unittest

from ..area_circle import area_of_circle


class TestAreaOfCircle(unittest.TestCase):
"""
Unit tests for the area_of_circle function.
"""

def test_positive_radius(self):
"""Test area calculation with a positive radius."""
self.assertAlmostEqual(area_of_circle(1), 3.141592653589793)
self.assertAlmostEqual(area_of_circle(2.5), 19.634954084936208)

def test_zero_radius(self):
"""Test area calculation with a radius of zero."""
self.assertAlmostEqual(area_of_circle(0), 0.0)

def test_negative_radius(self):
"""Test area calculation with a negative radius."""
with self.assertRaises(ValueError):
area_of_circle(-1)

def test_large_radius(self):
"""Test area calculation with a large radius."""
self.assertAlmostEqual(area_of_circle(1e6), math.pi * 1e6 * 1e6)


if __name__ == "main":
unittest.main()
106 changes: 106 additions & 0 deletions solutions/tests/test_check_prime_number.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

"""
Unit Test for check_prime_number Function
This script contains a unit test for the `check_prime_number` function,
which checks whether a given number
is prime or not.
A prime number is a number greater than 1 that has no divisors other than 1 and itself.
The test class `TestIsPrime` includes various test cases to verify that the function works correctly
for different types of inputs:
- Prime numbers
- Non-prime numbers
- Edge cases (such as 0, 1, and negative numbers)
- Larger prime numbers
Test cases include:
- Testing prime numbers like 2, 3, 5, 7, 13.
- Testing non-prime numbers like 1, 4, 6, 8, 9, 10, 14.
- Checking edge cases such as 0 and negative numbers.
To run the tests, use the Python `unittest` framework.
The tests will provide feedback on the correctness
of the `check_prime_number` function.
Author: Özgür ÖZBEK
Date: 11th January 2025
Group: ET6-foundations-group-16
"""

import unittest
from ..check_prime_number import check_prime_number


class TestCheckPrimeNumber(unittest.TestCase):
"""Test case for the check_prime_number function."""

def test_prime(self):
"""Test prime number 2."""
self.assertTrue(check_prime_number(2))

def test_prime_3(self):
"""Test prime number 3."""
self.assertTrue(check_prime_number(3))

def test_prime_5(self):
"""Test prime number 5."""
self.assertTrue(check_prime_number(5))

def test_prime_7(self):
"""Test prime number 7."""
self.assertTrue(check_prime_number(7))

def test_prime_13(self):
"""Test prime number 13."""
self.assertTrue(check_prime_number(13))

def test_non_prime_4(self):
"""Test non-prime number 4."""
self.assertFalse(check_prime_number(4))

def test_non_prime_6(self):
"""Test non-prime number 6."""
self.assertFalse(check_prime_number(6))

def test_non_prime_8(self):
"""Test non-prime number 8."""
self.assertFalse(check_prime_number(8))

def test_non_prime_9(self):
"""Test non-prime number 9."""
self.assertFalse(check_prime_number(9))

def test_non_prime_10(self):
"""Test non-prime number 10."""
self.assertFalse(check_prime_number(10))

def test_non_prime_14(self):
"""Test non-prime number 14."""
self.assertFalse(check_prime_number(14))

def test_edge_case_0(self):
"""Test edge case 0."""
with self.assertRaises(AssertionError):
check_prime_number(0)

def test_edge_case_negative(self):
"""Test edge case negative number."""
with self.assertRaises(AssertionError):
check_prime_number(-1)

def test_non_prime_1(self):
"""Test non-prime number 1."""
with self.assertRaises(AssertionError):
check_prime_number(1)

def test_edge_case_large_prime(self):
"""Test edge case with large prime."""
self.assertTrue(check_prime_number(97))


if __name__ == "__main__":
unittest.main()
Loading

0 comments on commit d994148

Please sign in to comment.