コード例 #1
0
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))
コード例 #2
0
from classes import Planet

naboo = Planet('naboo', 23, 3)
print(f'name: {naboo.name}')
print(naboo.spin('a very high speed'))
コード例 #3
0
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())
コード例 #4
0
from classes import Planet

mars = Planet('Mars', 300000, 8, 'Mars System')
print(f'Name: {mars.name}')
print(mars.spin('a very high speed'))
コード例 #5
0
from classes import Planet

naboo = Planet('Naboo', 3200000, 7.5, 'Nabooo System')

print(f'Name: {naboo.name}')
print(Planet.spin("a very high speed"))
コード例 #6
0
ファイル: test.py プロジェクト: javieramirez90/basicsReview
from classes import Planet

naboo = Planet('Naboo', 23400000, 'Solar System')
print(naboo.spin())

print(f'Name: {naboo.name}')
コード例 #7
0
from classes import Planet

naboo = Planet('Naboo', 300000, 8, 'Naboo System')
print(f'Name: {naboo.name}')
print(Planet.spin('a very high speed'))
コード例 #8
0
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
コード例 #9
0
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'))
コード例 #10
0
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())
コード例 #11
0
from classes import Planet
planetXR = Planet('Naboo', 300000, 8, 'Naboo system')
print(f'Name: {planetXR.name}')
print(planetXR.spin('very high speed'))
コード例 #12
0
from classes import Planet
naboo = Planet('Naboo', 2423, 5, 'Naboo system')
print(f'Name:{naboo.name}')
コード例 #13
0
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
コード例 #14
0
from classes import Planet

bilal = Planet('hilal', 33, 'algerian', 'no')
bilal.console()
コード例 #15
0
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'))
コード例 #16
0
from classes import Planet

naboo = Planet('Naboo', 300000, 8, 'Naboo System')
print(naboo.orbit())
print(Planet.commons())
print(Planet.spin())
コード例 #17
0
from classes import Planet

naboo = Planet('naboo', 300000, 8, 'Naboo System')
print(naboo.spin('A very high speed'))
print(f'Name: {naboo.name}')
コード例 #18
0
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)
コード例 #19
0
from classes import Planet
naboo = Planet('Naboo', 32243, 5, 'Naboo system')
print(f'name:{naboo.name}')
print(naboo.spin('a very high speed'))
コード例 #20
0
ファイル: test.py プロジェクト: UnknownMonk/Python_basics
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'))
コード例 #21
0
ファイル: test.py プロジェクト: code7cs/python
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'))