In summary, the syntax Please repeat this many times
.
ViewController.swift
for i in 0..<10 {
//In this case, until i reaches the 0th to 9th times{}That the contents are repeated
//That it will be done 10 times
print(i)
//In this case 0-9 is displayed in the log
}
When there are two . Like
0 .. <10, it is
0 or more and less than 10, and conversely, when there are three
. Like 0 ... <10
, it is. It means 0 or more and 10 or less
.
Recommended Posts