print("**********特殊用法************")
print("**********多变量赋值************")
local a,b,c = 1,2,"123"
print(a)
print(b)
print(c)
a,b,c = 1,2
print(a)
print(b)
print(c)
a,b,c = 1,2,3,4,5,6
print(a)
print(b)
print(c)
print("**********多返回值************")
function Test()
return 10,20,30,40
end
a,b,c = Test()
print(a)
print(b)
print(c)
a,b,c,d,e = Test()
print(a)
print(b)
print(c)
print(d)
print(e)
print("**********and or************")
print( 1 and 2 )
print( 0 and 1)
print( nil and 1)
print( false and 2)
print( true and 3)
print( true or 1 )
print( false or 1)
print( nil or 2)
x = 1
y = 2
local res = (x>y) and x or y
print(res)
![](https://img2020.cnblogs.com/blog/2159041/202010/2159041-20201028140505448-263495180.png)
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】凌霞软件回馈社区,博客园 & 1Panel & Halo 联合会员上线
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】博客园社区专享云产品让利特惠,阿里云新客6.5折上折
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步