1
I’m a beginner in python and in gera programming, I’m doing a project for the school science fair and need help to add this function to my graphical interface (I’m using python 3.6 and I’m on Ubuntu):
class Assistant(Screen):
def frase(self):
    resp = input('Olá! O meu nome é AVUSA. A sua Assistente Virtual para o Uso Sustentável da Água.\n'
                   'Você você precisa de assistência  quanto ao controle do uso de água na sua residência?')
    if resp == 'sim':
        temChuv = int(input('Então vamos lá! Quanto tempo, em minutos, você gasta debaixo do chuveiro em um dia?:'))
        Lbanho = temChuv * 6
        temVaso = float(input('Beleza! Quantas descargas você costuma dar em um dia?:'))
        LVaso = temVaso * 12
        tempb = float(input('Ok! Quanto tempo, em minutos, você gasta usando a pia do banheiro em um dia?:'))
        Lpb = tempb * 5
        tempc = float(input('Ok! Quanto tempo, em minutos, você gasta usando a pia da cozinha em um dia?:'))
        Lpc = tempc * 6
        temTan = float(input('Ok! Quanto tempo, em minutos, você gasta usando o tanquinho, em um dia?'))
        LTan = temTan * 15
        temMaq = float(input('Beleza! Quantas vezes você utiliza a máquina de lavar roupas por semana?:'))
        LMaq = temMaq * 12
        TotalpDia = float(Lbanho + LVaso + Lpc + Lpb + LMaq + LTan)
        TotalpMes = float(TotalpDia * 31)
        AcreDia = (TotalpDia * 3.14 / 1000)
        AcreMes = (31 * AcreDia)
        conredu = float(AcreMes - 10.54)
        print('Você consome cerca de {:.2f} litros de água por dia!\n'.format(TotalpDia))
        print('E em um mês você consome cerca de {:.2f} litros de água!\n'.format(TotalpMes))
        print(
            'Isto representa um acréscimo de cerca de R${:.2f} por dia e R${:.2f} por mês na sua conta de água\n'.format
            (AcreDia, AcreMes))
        if TotalpDia > 110.0:
            print('A ONU (Organização das Nações Unidas) diz que 110.0 litros por dia são suficientes para\n'
                  'atender as necessidades básicas de consumo e higiene de uma pessoa. ')
            print(
                'Portanto, caso você reduza seu consumo de água de {:.2f} para 110 litros por dia. Conseguirá\numa redução de '
                'cerca de R$ 10.54 na sua conta de água, que passará a ser R${:.2f}, e estará fazendo a sua parte no uso consciente deste recurso.'.format(
                    TotalpDia, conredu))
        else:
            print(
                'Parabéns! Você está dentro do limite do uso diário de água estipulado pela ONU (Organização das Nações Unidas')
    elif resp == 'não':
        print('Tá bom. Se precisar, estarei sempre à sua disposição! :)')
test.Kv:
Menu: name:'menu'
Tarefas:
    name:'tarefas'
Assistente:
    name:'assistente'
: Boxlayout: orientation:'vertical' padding:root.width*0.32, root.height*0.25 Spacing:'25dp' canvas: Color: rgba:1,1,1,1 Rectangle: size:self size. pos:self.pos
    Image:
        source:'logo.png'
        size_hint_y:2.3
        allow_strech:True
    Botao:
        text:'Tarefas'
        on_release:app.root.current = 'tarefas'
        on_release:app.root.transition.direction = 'right'
    Botao:
        text:'Assistente'
        on_release:app.root.current = 'assistente'
        on_release:app.root.transition.direction = 'left'
    Botao:
        text:'Sair'
        on_release:root.confirmacao()
: Boxlayout: orientation:'vertical' canvas: Color: rgba:1,1,1,1 Rectangle: size:self size. pos:self.pos
    ActionBar:
        ActionView:
            ActionPrevious:
                title:'Tarefa'
                on_release:app.root.current = 'menu'
            ActionButton:
                text:'Sair'
                on_release:app.stop()
    ScrollView:
        BoxLayout:
            id:box
            orientation:'vertical'
            size_hint_y:None
            height:self.minimum_height
            color:0,0,0,1   
    BoxLayout:
        size_hint_y:None
        height:'40sp'
        TextInput:
            id:texto
        Button:
            text:'+'
            size_hint_x:None
            width:'40sp'
            on_release:root.addWidget()
            background_color:(0,1,2,1)
: size_hint_y:None height:'100sp' Splitter: strip_size:'3pt' sizable_from:'bottom' Label: id label: font_size:'20sp' color:0,0,0,1
Button:
    text:'X'        
    size_hint_x:None
    width:'40sp'
    on_release:app.root.get_screen('tarefas').removeWidget(root)
    background_color:(0,1,2,1)
: Boxlayout: orientation:'vertical' canvas: Color: rgba:1,1,1,1 Rectangle: size:self size. pos:self.pos
    ActionBar:
        ActionView:
            ActionPrevious:
                title:'Assistente'
                on_release:app.root.current = 'menu'
            ActionButton:
                text:'Sair'
                on_release:app.stop()
    ScrollView:
        BoxLayout:
            id:box
            orientation:'vertical'
            size_hint_y:None
            height:self.minimum_height
            color:0,0,0,1   
    BoxLayout:
        size_hint_y:None
        height:'40sp'
        TextInput:
            id:texto
        Button:
            text:'>'
            size_hint_x:None
            width:'40sp'
            background_color:(0,1,2,1)
            on_release:??????????????