Login
|
Signup
langref.org
-
php
and
clojure
add..
all
cpp
csharp
erlang
fantom
fsharp
go
groovy
haskell
java
ocaml
perl
python
ruby
scala
Home
All
Solved
Unsolved
Strings
Numbers
Regex
Lists
Maps
Structure
Files
Dates
OOP
Networking
XML
Algorithms
Misc
Parallel
View Problem
Lists
Access
Fetch an element of a list by index
Given the list
[One, Two, Three, Four, Five]
, fetch the third element (
'Three'
)
php
$list = array("One", "Two", "Three", "Four", "Five");
$three = $list[2];
<?php
$list = array("One", "Two", "Three", "Four", "Five");
$three = $list[2];
?>
clojure
(nth '[One Two Three Four Five] 2)
(nth '[One Two Three Four Five] 2)
Submit a new solution for
php
or
clojure
There are 23 other solutions in
additional
languages (
cpp
,
csharp
,
erlang
,
fantom
...)