Skip to content

Commit

Permalink
another try
Browse files Browse the repository at this point in the history
  • Loading branch information
ArwaAbdelkhalik committed Jan 12, 2025
1 parent 5cdce93 commit 6ea1994
Showing 1 changed file with 5 additions and 14 deletions.
19 changes: 5 additions & 14 deletions solutions/tests/test_kgs_to_lbs.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,20 @@
@author: Arwa Mohamed
"""

import unittest


def kg_to_lbs(kg):
"""Converts a given weight from kilograms (kg) to pounds (lbs).
"""
Converts a given weight from kilograms (kg) to pounds (lbs).
Parameters:
Args:
kg (float): Weight in kilograms.
Returns:
float: Equivalent weight in pounds.
>>> kg_to_lbs(75):
165.347
>>> kg_to_lbs(34):
74.957
>>> kg_to_lbs(10):
22.046
Raises:
ValueError: If the input is not a positive number.
"""
Expand All @@ -31,9 +25,6 @@ def kg_to_lbs(kg):
return kg * 2.20462





class TestKgToLbs(unittest.TestCase):
def test_positive_conversion(self):
self.assertAlmostEqual(kg_to_lbs(1), 2.20462, places=5)
Expand Down

0 comments on commit 6ea1994

Please sign in to comment.