1.常量與變量。
2.
類型標(biāo)注
let型為數(shù)字整型。 double型為小數(shù)點(diǎn)型(精確)。float型為小數(shù)點(diǎn)型。
Bool型只有兩種結(jié)果:true/false。? string型:字符串類型
3.常量與變量的命名。
let hello=“hello World"? ? 你好使用英文hello
4.輸出常量和變量。
print(hello)? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? “hello? World\n”
4.1? 字符串查值
print(“字符串\(hello)”)
5.注解。
“//”后內(nèi)容計算機(jī)不會識別
6.let cat=“mao”;print(cat)
7.類型轉(zhuǎn)換。
不同類型的常量無法相加,如果要相加將其轉(zhuǎn)化為一種類型。

將three從int類型轉(zhuǎn)化為double型