Build a Planet Class - Build a Planet Class

Tell us what’s happening:

Q18.
I have tried several ways to call the orbit method on the planet objects but still not passing. kindly advise

Your code so far

class Planet:
  def __init__(self, name, planet_type, star):

    self.name = name
    self.planet_type = planet_type
    self.star = star

    if not isinstance(name, str):
      raise TypeError("name, planet type, and star must be strings")
    if not isinstance(planet_type, str):
      raise TypeError("name, planet type, and star must be strings")
    if not isinstance(star, str):
      raise TypeError("name, planet type, and star must be strings")

    if name == '':
      raise ValueError("name, planet_type, and star must be non-empty strings")
    if planet_type == '':
      raise ValueError("name, planet_type, and star must be non-empty strings")
    if star == '':
      raise ValueError("name, planet_type, and star must be non-empty strings")

  def orbit(self):
    return f"{self.name} is orbiting around {self.star}..."

  def __str__(self):
    return f"Planet: {self.name} | Type: {self.planet_type} | Star: {self.star}"

planet_1 = Planet('Mercury', 'terrestrial', 'Sun')
planet_2 = Planet('Neptune', 'ice giant', 'Sun')
planet_3 = Planet('Proxima Centauri b', 'super-Earth', 'Proxima Centauri')

print(planet_1)
print(planet_2)
print(planet_3)

planet_1.orbit()
planet_2.orbit()
planet_3.orbit()




Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/142.0.0.0 Safari/537.36

Challenge Information:

Build a Planet Class - Build a Planet Class

i got it, i had to add the print call at each orbit call