Problem 45991. Find the position of planet in solarsystem

Write a funtion named nthplanet which takes name of the planet as input string and provides the position of the planet, starting from Mercury at 1st position and Neptune at 8th , as output.(For those who are sad because I ignored Pluto, Pluto is considered as Dwarf planet by IAU)

If

x = 'Earth'

then

nthplanet(x)

gives

3

Please have a look at the Testsuite before you begin

Solution Stats

65.0% Correct | 35.0% Incorrect
Last Solution submitted on Aug 15, 2024

Problem Comments

Solution Comments

Show comments

Problem Recent Solvers26

Suggested Problems

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!