-3
I’m creating an expense control to be used as a data science study. This is my expression:
def cadastro():
descritivo = []
valor = []
condicao = []
mes = input('Qual o mês vigente: ')[0:3].upper()
quantidade = int(input('Quantas compras deseja registrar? '))
for i in range(quantidade):
dia = input("Qual o dia da sua compra: ")
des = input('O que você comprou? ').upper()
val = float(input('Qual o valor da compra: '))
cond = input('Qual o método de pagamento? ').upper()
descritivo.append(des)
valor.append(val)
condicao.append(cond)
data = (f'2021/{mes}/{dia}')
base = { 'Data': data,
"Descritivo": descritivo,
"Valor": valor,
"Condição": condicao}
dados = pd.DataFrame(data=base)
return dados
cadastro()
The way it is, the date will always be unique to all other values. I would like to know how to add a new date, in this format 2021/Feb/01 and from the date, register as many products as I want.
as I ask the user to fill this with input?
Do not place compliments or thanks in questions or answers: Ref:https://answall.com/help/behavior
– Augusto Vasques