El viernes, 21 de febrero de 2014 08:26:52 UTC-6, Mauro escribió: > > Yes, Julia vectors are basically like python lists. >
OK, great, thanks! David. > > julia> v=(Int,Int)[] > 0-element Array{(Int64,Int64),1} > > julia> push!(v,(1,2)) > 1-element Array{(Int64,Int64),1}: > (1,2) > > > On Friday, February 21, 2014 2:23:56 PM UTC, David P. Sanders wrote: >> >> Hi, >> >> I am having trouble finding the best equivalent of a list in Python, and >> the Pythonic idiom of creating an empty list and then adding elements one >> by one with .append(). >> For example, how would I do this for a collection of ordered pairs >> (Int64, Int64)? I don't seem able even to create the correct type: >> >> julia> v = Vector{(Int64, Int64)}() >> ERROR: type cannot be constructed >> >> Then I want to do something like >> >> push!(v, (1, 2)) >> >> Thanks, >> David. >> >