def mouse_pressed(event): """ When mouse is pressed, create a planet # TODO """ global _planets for p in _planets: if p.is_inside(event.x, event.y): p.make_bigger() return _planets.append(Planet(event.x, event.y))
from classes import Planet naboo = Planet('naboo', 23, 3) print(f'name: {naboo.name}') print(naboo.spin('a very high speed'))
from classes import Planet aplanet = Planet() print(f'Name is: {aplanet.name}') print(f'Radius is: {aplanet.radius}') print(f'The gravity is equal to {aplanet.gravity}') print(aplanet.orbit()) print(aplanet.planetshape())
from classes import Planet mars = Planet('Mars', 300000, 8, 'Mars System') print(f'Name: {mars.name}') print(mars.spin('a very high speed'))
from classes import Planet naboo = Planet('Naboo', 3200000, 7.5, 'Nabooo System') print(f'Name: {naboo.name}') print(Planet.spin("a very high speed"))
from classes import Planet naboo = Planet('Naboo', 23400000, 'Solar System') print(naboo.spin()) print(f'Name: {naboo.name}')
from classes import Planet naboo = Planet('Naboo', 300000, 8, 'Naboo System') print(f'Name: {naboo.name}') print(Planet.spin('a very high speed'))
from classes import Planet planet = Planet('Andy', 5000, 4.5, 'The system') print(f'Name is: {planet.name}') print(f'Radius is: {planet.radius}') print(f'The gravity is: {planet.gravity}') print(planet.spin('at a very high speed')) print(Planet.spin()) #Packages are a collection of modules
from classes import Planet naboo = Planet('Naboo', 3000, 8, 'Naboo System') # print(f'Name: {naboo.name}') # print(f'Radius: {naboo.radius}') # print(naboo.shape) # print(Planet.shape) # print(naboo.spin('a very high speed'))
from classes import Planet naboo = Planet('naboo', 23, 3) print(f'name: {naboo.name}') print(naboo.spin(' a very high speed')) new = Planet('lohit', 'new', 23) print(new.orbit())
from classes import Planet planetXR = Planet('Naboo', 300000, 8, 'Naboo system') print(f'Name: {planetXR.name}') print(planetXR.spin('very high speed'))
from classes import Planet naboo = Planet('Naboo', 2423, 5, 'Naboo system') print(f'Name:{naboo.name}')
from classes import Planet # import the Planet Class venus = Planet('Venus', 30000, 8, 'Solar System') print(f'Name : {venus.name}') print(venus.orbit()) # PACKAGES ARE COLLECTION OF MODULES
from classes import Planet bilal = Planet('hilal', 33, 'algerian', 'no') bilal.console()
from classes import Planet planetX = Planet('planetX', 300000, 8, 'X System') print(f'Name : {planetX.name}') print(f'Radius : {planetX.radius}') print(f'Gravity : {planetX.gravity}') print(planetX.orbit()) print(planetX.commons()) print(planetX.spin('a very high speed'))
from classes import Planet naboo = Planet('Naboo', 300000, 8, 'Naboo System') print(naboo.orbit()) print(Planet.commons()) print(Planet.spin())
from classes import Planet naboo = Planet('naboo', 300000, 8, 'Naboo System') print(naboo.spin('A very high speed')) print(f'Name: {naboo.name}')
from classes import System, Body, Planet, Star, Moon solar_system = System.create() sun = Star("Sun", 1.989 * (10**30), "G") earth = Planet("Earth", 5.972 * (10**24), 24, 365) luna = Moon("Luna", 7.342 * (10**22), 27, earth) solar_system.add(sun) solar_system.add(earth) solar_system.add(luna) solar_system.add(luna) alpha_centauri = System.create() alpha_centauri_a = Star("Alpha Centauri A", 2.188 * (10**30), "G") alpha_centauri_b = Star("Alpha Centauri B", 1.804 * (10**30), "K") alpha_centauri_c = Star("Alpha Centauri C", 2.446 * (10**29), "G") alpha_centauri.add(alpha_centauri_a) alpha_centauri.add(alpha_centauri_b) alpha_centauri.add(alpha_centauri_c) alpha_centauri.add(alpha_centauri_c) print() print("Bodies in the solar system:") print(solar_system) print("Total mass:") print(solar_system.total_mass()) print() print("Bodies in the alpha centauri system:") print(alpha_centauri)
from classes import Planet naboo = Planet('Naboo', 32243, 5, 'Naboo system') print(f'name:{naboo.name}') print(naboo.spin('a very high speed'))
from classes import Planet naboo = Planet("Naboo", 30000, 8, 'Naboo') print(f"Name is : {naboo.name}") print(f"Radius is : {naboo.radius}") print(f"the gravity is: {naboo.gravity}") print(naboo.orbit()) print(naboo.commons()) print(Planet.spin('at a very high speed'))
from classes import Planet naboo = Planet('Naboo', 500, 8.8, 'Naboo system') print(f'Name is: {naboo.name}') print(f'Radius is: {naboo.radius}') print(f'Gravity is: {naboo.gravity}') print(naboo.spin('a very high speed'))