🅰Б
Size: a a a
🅰Б
🅰Б
АН
🅰Б
АН
var z:[Any]=[7, "hello",9,18.0,"world"]print(t)
for t in z{
if t is Double{
if t as! Double==18.0{
continue
}
}
if t is String{
if t as! String=="hello"{
continue
}
}
🅰Б
var z:[Any]=[7, "hello",9,18.0,"world"]print(t)
for t in z{
if t is Double{
if t as! Double==18.0{
continue
}
}
if t is String{
if t as! String=="hello"{
continue
}
}
var z: [Any] = [7, "hello", 9, 18.0, "world"]
for t in z {
if let result = t as? Int {
print(result)
} else if let result = t as? String {
print(result)
} else if let result = t as? Double {
print(result)
}
}
АН
var x:Int=12
print("Variable type \(x.var)")
И выводила так 🅰Б
var x:Int=12
print("Variable type \(x.var)")
И выводила так print("type of: ", type(of: t))
АН
print("type of: ", type(of: t))
АН
print("type of: ", type(of: t))
🅰Б
GZ
VO
hs
🅰Б
hs
I
hs
АН
let anyType1: Any = 2
let anyType2: Any = 3
if let int1 = anyType1 as? Int, let int2 = anyType2 as? Int {
print("Сумма чисел: ", int1 + int2)
}