swift print code example
Example 1: swift print
print("Hello World")
let num = 5
print(num)
print("a num: " + num)
print("a num: \(num)")
Example 2: print things in swift
print("Hello World")
print("Hello Again")
print("Hello World", terminator="")
print("Hello Again")
print(123.45)
var message: String = "Hello"
print(message)
Example 3: print string sqift
var str1 = "Hello, world"
print(str1)
Example 4: printf in swift
let x = 3.1415926
print(String(format: "%.2f", x))
print(String(format: "%2.2f", x))