I am a beginner in python3, I have the following code that I am doing and paneas I go in the second option
def menu():
print ('Selecciona una opcion')
print ('1. Ver')
print ('2. Agregar')
print ('3. Eliminar')
print ('4. Modificar')
articulos ={'items':'id':0,'nombre':'elemento1','precio':12000,'cantidad':50},'id':1,'nombre':'elemento2','precio':12000,'cantidad':50}]}
arti = articulos.get('items')
menu()
opcion = input('>>')
if opcion == '1':
print ('Items del inventario')
print (arti)
elif opcion == '2':
print ('Agregar item')
#Aqui el problema
igg = arti.append('items{id}') + int(1)
#Aqui el problema
nombre2=input('digite el nombre >>')
precio2=input('digite el precio >>')
cantidad2=input('digite la cantitdad actual >>')
arti.append({'id':igg,'nombre':nombre2,'precio':precio2,'cantitdad':cantidad2})
print (arti)
elif opcion == '3':
print ('Hola3')
elif opcion == '4':
print ('Hola4')
else:
print ('No has pulsado el rango')
What I want is to take the last id of the list and add one, which would be the new id, but I do not know how to do that part of choosing the last number of the last id, please help!
Thanks !!