Skip to content

Commit

Permalink
Correct planetary values
Browse files Browse the repository at this point in the history
  • Loading branch information
christiaanwinchub committed Sep 6, 2023
1 parent fdfd160 commit a5f4370
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 17 deletions.
10 changes: 5 additions & 5 deletions wincpy/checks/7b9401ad7f544be2a23321292dd61cb6.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
22 changes: 10 additions & 12 deletions wincpy/solutions/7b9401ad7f544be2a23321292dd61cb6/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,25 +17,23 @@ def greet(name, greeting="Hello, <name>!"):

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


Expand Down

0 comments on commit a5f4370

Please sign in to comment.