4
I have the following class:
class Usuario(object):
    def __init__(self):
        self.Nome = ''
        self.Email = ''
        self.SalarioBruto = 0.0
        self.SalarioLiquido = 0.0
        self.Cargo = ''
        self.Despesas = Despesas()
        self.Ganhos = Ganhos()
        self.TipoRelatorio = TipoRelatorio()
With the following tasks:
u = Usuario()
u.Nome = 'Tiago'
u.Email = '[email protected]'
u.SalarioBruto = 1.000
u.SalarioLiquido = 980.00
u.Despesas.Prioridade = 'Alta'
u.Despesas.Situacao = True
u.Despesas.Valor = 300.00
u.Despesas.Categoria = 'Alimentação'
u.Ganhos.Periodo.Fixa = '100'
u.Ganhos.Fonte = 'Freelancer'
u.TipoRelatorio.Semanal.DataInicial = '17/09/2018'
u.TipoRelatorio.Semanal.DataFinal = '24/09/2018'
I want to print the variable u without having to write a print for each of the attributes, I can do this in Python?
Thank you very much for the reply I got here!
– Tiago Luca
Any doubt we’re here.
– ThiagoO