From a5f43702c47cdd8109d3365235ae9ad626320c41 Mon Sep 17 00:00:00 2001 From: christiaanwinchub Date: Wed, 6 Sep 2023 11:12:13 +0200 Subject: [PATCH] Correct planetary values --- .../7b9401ad7f544be2a23321292dd61cb6.py | 10 ++++----- .../7b9401ad7f544be2a23321292dd61cb6/main.py | 22 +++++++++---------- 2 files changed, 15 insertions(+), 17 deletions(-) diff --git a/wincpy/checks/7b9401ad7f544be2a23321292dd61cb6.py b/wincpy/checks/7b9401ad7f544be2a23321292dd61cb6.py index ba09b9e..60a8582 100644 --- a/wincpy/checks/7b9401ad7f544be2a23321292dd61cb6.py +++ b/wincpy/checks/7b9401ad7f544be2a23321292dd61cb6.py @@ -31,17 +31,17 @@ def check_force(student_module): assert student_module.force(10) == 98, "Did you use earth's gravity by default?" assert ( - round(student_module.force(50)) == 490 + round(student_module.force(50)) == 196 ), "Did you use earth's gravity by default?" - assert student_module.force(10, "pluto") == 7, "'pluto' is not handled correctly" - assert student_module.force(10, "saturn") == 90, "'saturn' is not handled correctly" + assert student_module.force(10, "pluto") == 6, "'pluto' is not handled correctly" + assert student_module.force(10, "saturn") == 104, "'saturn' is not handled correctly" assert student_module.force(10, "earth") == 98, "'earth' is not handled correctly" assert ( - student_module.force(10, "jupiter") == 231 + student_module.force(10, "jupiter") == 249 ), "'jupiter' is not handled correctly" assert ( - student_module.force(10, "neptune") == 110 + student_module.force(10, "neptune") == 112 ), "'neptune' is not handled correctly" assert student_module.force(10, "moon") == 16, "'moon' is not handled correctly" diff --git a/wincpy/solutions/7b9401ad7f544be2a23321292dd61cb6/main.py b/wincpy/solutions/7b9401ad7f544be2a23321292dd61cb6/main.py index bf92f8c..92b4e00 100644 --- a/wincpy/solutions/7b9401ad7f544be2a23321292dd61cb6/main.py +++ b/wincpy/solutions/7b9401ad7f544be2a23321292dd61cb6/main.py @@ -17,25 +17,23 @@ def greet(name, greeting="Hello, !"): def force(mass, body="earth"): bodies = { - "jupiter": 23.1, - "neptune": 11.0, - "saturn": 9.0, - "earth": 9.8, - "uranus": 8.7, - "venus": 8.9, - "mars": 3.7, + "sun": 274, "mercury": 3.7, - "moon": 1.6, - "pluto": 0.7, + "venus": 8.87, + "earth": 9.798, + "mars": 3.71, + "jupiter": 24.92, + "saturn": 10.44, + "uranus": 8.87, + "neptune": 11.15, + "pluto": 0.58, + "moon": 1.62 } force = mass * bodies[body] return force -print(force(10, "moon")) - - # 3