My code does not work right now. I am trying to take names and add it by itself in the loop but the complier is giving me a error message and the code is not being printed.
let names = [Double(2),3,8] as [Any]
let count = names.count
for i in 0..<count {
print((names[i]) + names[i])
}
as [Any]?namesis an[Any], so the elements could be, well, anything. You cannot add together arbitrary things – what ifnames[i]was aBool?