ej16.py 255 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Composición"""
class A(object):
    def a1(self):
        print("a1")

class B(object):
    def b(self):
        print ("b")
        A().a1()


if __name__ =="__main__":
    objetoB = B()
    objetoB.b()