Extract multiple values from a single variable in python

3

If I have a single data entry, can I retrieve multiple values assigned to my variable and rights to the other?

representation:

vrvl = int(input("Dia.mês.ano: ))
dia = dia
mes = mes
ano = ano
#entrada == 22.08.17
print("Dia:", dia)
print("Mês:", mes)
print("Ano:", ano)
    
asked by anonymous 22.08.2017 / 13:26

2 answers

1

You could also use a list to store information, something like this:

dia, mes, ano = input("Dia Mês Ano: ").split(' ')
lista = [dia, mes, ano]

It could make it easier to manipulate this information depending on the goals of your code.

    
24.10.2017 / 02:18