Exemplo n.º 1
0
# -*-coding:utf8

mystuff = {'apple': "I AM APPLES!"}
print(mystuff['apple'])

import mystuff_module

mystuff_module.apple()
print(mystuff_module.tangerine)


class MyStuff(object):
    def __init__(self) :
        self.tangerine = "And now a thousand years between"

    def apple(self):
        print("I AM CLASSY APPLES!")

# end class My Stuff

thing = MyStuff()
thing.apple()
print(thing.tangerine)

class Song(object):
    def __init__(self, lyrics):
        self.lyrics = lyrics

    def sing_me_a_song(self):
        for line in self.lyrics:
            print(line)
Exemplo n.º 2
0
# -*-coding:utf8

mystuff = {'apple': "I AM APPLES!"}
print(mystuff['apple'])

import mystuff_module

mystuff_module.apple()
print(mystuff_module.tangerine)


class MyStuff(object):
    def __init__(self):
        self.tangerine = "And now a thousand years between"

    def apple(self):
        print("I AM CLASSY APPLES!")


# end class My Stuff

thing = MyStuff()
thing.apple()
print(thing.tangerine)


class Song(object):
    def __init__(self, lyrics):
        self.lyrics = lyrics

    def sing_me_a_song(self):