SwiftPamphletApp icon indicating copy to clipboard operation
SwiftPamphletApp copied to clipboard

打印 print("")

Open ming1016 opened this issue 4 years ago • 1 comments

控制台打印值

print("hi")
let i = 14
print(i)
print("9月\(i)是小柠檬的生日")

ming1016 avatar Nov 15 '21 10:11 ming1016

for i in 1...3{
    print(i)
}
// output:
// 1
// 2
// 3

// 使用terminator使循环打印更整洁
for i in 1...3 {
    print("\(i) ", terminator: "")
}
// output:
// 1 2 3

Sinter0 avatar Dec 12 '21 04:12 Sinter0