
正文
Python编程和 Lua编程的比较
提示:扫一扫查出行【扫一扫了解最新限行尾号】
复制提示
Python编程和 Lua编程的比较2016.4.21
- 定义函数:
- python:
def functionname( parameters ):
"函数_文档字符串"
function_suite
return [expression]
- lua:
--[[ function returning the max between two numbers --]]
function max(num1, num2) if (num1 > num2) then
result = num1;
else
result = num2;
end return result;
end
- 定义函数:
- python:
def functionname( parameters ):
"函数_文档字符串"
function_suite
return [expression] - lua:
--[[ function returning the max between two numbers --]]
function max(num1, num2) if (num1 > num2) then
result = num1;
else
result = num2;
end return result;
end
未完,待续……






