Using the following table (source) write some code that takes the names of two planets and returns the distance between them:
+-------------------+---------------+
| Planets | Distance (km) |
+-------------------+---------------+
| Mercury -> Venus | 50290000 |
| Venus -> Earth | 41400000 |
| Earth -> Mars | 78340000 |
| Mars -> Jupiter | 550390000 |
| Jupiter -> Saturn | 646270000 |
| Saturn -> Uranus | 1448950000 |
| Uranus -> Neptune | 1627450000 |
| Neptune -> Pluto | 1405380000 |
+-------------------+---------------+
Examples, input then output:
Mercury, Mars
170030000
Neptune, Jupiter
-3722670000
Earth, Earth
0
Note the negative sign there, as Jupiter comes before Neptune. They are also all integers.
Pluto doesn't have to be included (mostly because of a weird orbit which makes it hard to work out the distance - that distance given is my own calculation, but as Pluto is all famous now...).
By distances between planets I'm meaning orbits - I don't expect a date and working out where they are.
This is code golf, shortest code wins.
Mercury, Mars -> 170030000.0
? \$\endgroup\$