Declare a variable with the var
keyword.
var str = "Hello, playground" // str is of type string
str = 5 // This is an error, compiler won't let you assign an Int to a type String
Swift is a type safe language, meaning once a variable is declared as a certain type, it must maintain that type.
If you don’t specify the type of value you need, Swift uses type inference.