コード例 #1
0
from fleet import Fleet
from thing import Thing

fleet = Fleet()

# Töltsd fel a fleet példányt olyan módon, hogy a következő legyen a kimenet:
# 1. [ ] Get milk
# 2. [ ] Remove the obstacles
# 3. [x] Stand up
# 4. [x] Eat lunch

fleet.add(Thing('Get milk'))
fleet.add(Thing('Remove the obstacles'))
thing2 = Thing('Stand up')
thing2.complete()
fleet.add(thing2)
thing3 = Thing('Eat lunch')
thing3.complete()
fleet.add(thing3)

print(fleet)
コード例 #2
0
from fleet import Fleet
from thing import Thing

getMilk=Thing("Get milk")
getMilk.complete()
removeObs=Thing("Remove the obstacles")
removeObs.complete()
standUp=Thing("Stand up")
eatLunch=Thing("Eat lunch")
fleet = Fleet()
fleet.add(getMilk)
fleet.add(removeObs)
fleet.add(standUp)
fleet.add(eatLunch)
# Create a fleet of things to have this output:
# 1. [ ] Get milk
# 2. [ ] Remove the obstacles
# 3. [x] Stand up
# 4. [x] Eat lunch

print(fleet)
コード例 #3
0
from thing import Thing


class Fleet(object):
    def __init__(self):
        self.things = []

    def add(self, thing):
        self.things.append(thing)

    def __str__(self):
        result = ""
        for i in range(0, len(self.things)):
            result += str(i + 1) + ". " + self.things[i].__str__() + "\n"
        return result


thing1 = Thing('Get milk')
thing2 = Thing('Remove the obstacles')
thing3 = Thing('Stand up')
thing4 = Thing('Eat lunch')
fleet = Fleet()
fleet.add(thing1)
fleet.add(thing2)
fleet.add(thing3)
fleet.add(thing4)
thing3.complete()
thing4.complete()
print(fleet)
コード例 #4
0
# Create a fleet of things to have this output:
# 1. [ ] Get milk
# 2. [ ] Remove the obstacles
# 3. [x] Stand up
# 4. [x] Eat lunch

from fleet import Fleet
from thing import Thing

fleet = Fleet()

item_1 = Thing("Get milk")
print(item_1)
item_2 = Thing("Remove the obstacles")
print(item_2)
item_3 = Thing("Stand up")
item_3.complete()
print(item_3)
item_4 = Thing("Eat Lunch")
item_4.complete()
print(item_4)

print(fleet)
from fleet import Fleet
from thing import Thing

fleet = Fleet()
# Create a fleet of things to have this output:
# 1. [ ] Get milk
# 2. [ ] Remove the obstacles
# 3. [x] Stand up
# 4. [x] Eat lunch
item1 = Thing("Get milk!")
item2 = Thing("Remove the obstacles")
item3 = Thing("Stand up")
item4 = Thing("Eat lunch")

item3.complete()
item4.complete()

print(item1)
print(item2)
print(item3)
print(item4)

print(fleet)
コード例 #6
0
from fleet import Fleet
from thing import Thing

fleet = Fleet()
# Create a fleet of things to have this output:
# 1. [ ] Get milk
# 2. [ ] Remove the obstacles
# 3. [x] Stand up
# 4. [x] Eat lunch

milk = Thing("Get milk")
obstacle = Thing("Remove the obstacles")
stand = Thing("Stand up")
eat = Thing("Eat lunch")

stand.complete()
eat.complete()

fleet.add(milk)
fleet.add(obstacle)
fleet.add(stand)
fleet.add(eat)

print(fleet)
コード例 #7
0
from fleet import Fleet
from thing import Thing
fleet = Fleet()

# Create a fleet of things to have this output:
# 1. [ ] Get milk
# 2. [ ] Remove the obstacles
# 3. [x] Stand up
# 4. [x] Eat lunch
fleet.add(Thing('Get milk'))
fleet.add(Thing('Remove the obstacles'))

thing1 = Thing('stand up')
thing1.complete()
fleet.add(thing1)

thing2 = Thing('Eat lunch')
thing2.complete()
fleet.add(thing2)

print(fleet)
コード例 #8
0
ファイル: fleet_feladat.py プロジェクト: nandras88/python
from fleet import Fleet
from thing import Thing

fleet = Fleet()

get_milk = Thing('Get milk')
remove_obstacles = Thing('Remove obstacles')
stand_up = Thing('Stand up')
eat_lunch = Thing('Eat lunch')
stand_up.complete()
eat_lunch.complete()

fleet.add(get_milk)
fleet.add(remove_obstacles)
fleet.add(stand_up)
fleet.add(eat_lunch)

print(fleet)
コード例 #9
0
from fleet import Fleet
from thing import Thing

fleet = Fleet()

first = Thing(name='Get milk')
second = Thing(name='Remove the obstacles')
third = Thing(name='Stand up')
fourth = Thing(name='Eat lunch')

third.complete()
fourth.complete()

fleet.add(first)
fleet.add(second)
fleet.add(third)
fleet.add(fourth)

# Create a fleet of things to have this output:
# 1. [ ] Get milk
# 2. [ ] Remove the obstacles
# 3. [x] Stand up
# 4. [x] Eat lunch

print(fleet)
コード例 #10
0
from fleet import Fleet
from thing import Thing

fleet = Fleet()
# Create a fleet of things to have this output:
# 1. [ ] Get milk
# 2. [ ] Remove the obstacles
# 3. [x] Stand up
# 4. [x] Eat lunch

eat = Thing("Eat fruit")
walk = Thing("Walk")
train = Thing("Train")
sleep = Thing("Sleep")

eat.complete()
walk.complete()

fleet.add(eat)
fleet.add(walk)
fleet.add(train)
fleet.add(sleep)


print(fleet)
コード例 #11
0
from fleet import Fleet
from thing import Thing

fleet = Fleet()
t1 = Thing('Get milk')
t2 = Thing('Remove the obstacles')
t3 = Thing('Stand up')
t4 = Thing('Eat lunch')
# Create a fleet of things to have this output:
# 1. [ ] Get milk
# 2. [ ] Remove the obstacles
# 3. [x] Stand up
# 4. [x] Eat lunch

t3.complete()
t4.complete()
fleet.add(t1)
fleet.add(t2)
fleet.add(t3)
fleet.add(t4)

print(fleet)