Accessing a list element with a variable as index [duplicate]

i'm trying to retrieve an index to a variable and then using that variable to access the list.

The (simplified) code:

myList = {1, 5};
minElement = Position[myList, Min[myList]];
myList[[minElement]]


I get this error:

Part::pkspec1: The expression {{1}} cannot be used as a part specification.


The whole idea is to access other lists as well using the minElement index.

This seems like an easy question but i just can't find help about it.

marked as duplicate by m_goldberg, Mr.Wizard♦ list-manipulation StackExchange.ready(function() { if (StackExchange.options.isMobile) return; $('.dupe-hammer-message-hover:not(.hover-bound)').each(function() { var$hover = $(this).addClass('hover-bound'),$msg = $hover.siblings('.dupe-hammer-message');$hover.hover( function() { $hover.showInfoMessage('', { messageElement:$msg.clone().show(), transient: false, position: { my: 'bottom left', at: 'top center', offsetTop: -7 }, dismissable: false, relativeToBody: true }); }, function() { StackExchange.helpers.removeMessages(); } ); }); }); Aug 7 '17 at 12:26

• The results of Position are to be used with Extract. E.g. Extract[myList, minElement] – Edmund Aug 7 '17 at 3:04
• Thanks Edmund, this seems to work! – Emiliano Aug 7 '17 at 3:08
• @Emiliano I've found that frustrating, too. As @Edmund pointed out, Extract is the way to go. But in some cases I've gone for myList[[#]] & @@@ minElement instead, which gives the same answer. – aardvark2012 Aug 7 '17 at 3:33
• If you just need the position of the minimum, you could use Ordering[]. – J. M. will be back soon Aug 7 '17 at 4:02
• 115226 – Kuba Aug 7 '17 at 7:02

It's a formatting problem. maybe use, in a non-elegant way

myList = {1, 5};
minElement = Position[myList, Min[myList]][[1]][[1]];
myList[[minElement]]


which returns

1


as expected