list= [4,5,6,7,8]length =len(list)for i inrange (0, length):print(i)01234
swift
let list = [4,5,6,7,8]let length = list.countprint("type 1")for i inRange(0...length-1) { //..< 하면 컴파일 에러 발생 print(i)}print("type 2")for i in0..<length{print(i)}type 101234type 201234