Tell us what’s happening:
why isn’t step 14 or 16 working, wht am I doing wrong here
Your code so far
class Planet():
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}"
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 "" in name:
raise ValueError("name, planet_type, and star must be non-empty strings")
if "" in planet_type:
raise ValueError("name, planet_type, and star must be non-empty strings")
if "" in star:
raise ValueError("name, planet_type, and star must be non-empty strings")
Your browser information:
User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.1 Safari/605.1.15
Challenge Information:
Build a Planet Class - Build a Planet Class