摘要:
1、print如何不换行 print函数中end="\n"(换行)为默认值,如果不想换行,修改此默认值 for i in range(1, 5): print("*", end = '') 输出 **** 2、and-or 的使用 a = 1 b = 2 c = True and a or b 返回 阅读全文
摘要:
1、if 判断 lua中 nil 和 false 为 假,其余为真 2、table是否为空 local a = {} 正确是 if next(a) == nil then xx end 而不是 if a == {} then xx end 3、table长度 t = {1, 2, 3} t[1] = 阅读全文
摘要:
print"hello world" 同 print("hello world") type{} 同 type({}) 2.1 多赋值中,函数为最后一个表达式,则返回所有值,否则只返回第一个值 local x, y = test() -- x = 1, y = 2, 3丢弃 local x, y, 阅读全文