```var numbers=arrayOf( 11, 12, 13, ...
# announcements
a
Copy code
var numbers=arrayOf(
    11,
    12,
    13,
    14,
    15
)

var integer:MutableList<Int>=mutableListof()
        for(x in 0 until (numbers.size-1)) {
            integer[x]=numbers[x]
        }
for(element in integer) println("$element")
a
its
mutableListOf()
in line no 9
g
Also you need a space between > and =, otherwise it’s “greater than”
a
Tip: use val instead of var as suggested in kotlin docs since the number is never changed any instance
g
You are iterating
until size - 1
, so the last x is equal to
size - 2
a
Hi thanks I am new to kotlin can you suggest me how to go through kotlin
g
either you use
..
instead of
until
or you use `until size`… Or even better
numbers.forEachIndexed
a
One thing is using
Copy code
until
not right
g
until n
creates a range excluding
n
a
you'd have a ide such as intellij idea for debugging out compilation errors, it comes pretty handy in fixing those common mistakes, and font ligature with supported font such as fira code would help you for human rediability of code.
a
what is this font ligature ...
and fira code
a
https://github.com/tonsky/FiraCode it help in grouping out the working operators, its just a font basically such as -> would become arrow and >= become greater than equal to symbol
e
Also, if you’re trying to convert an array to a copied list you might try
numbers.toMutableList()
d
You should be calling
integer.add
instead of
set
(aka [])