UIFlow Guide
定义两个函数,传入参数进行简单运算
from m5stack import *
from m5ui import *
from uiflow import *
x = None
y = None
result = None
# Describe this function...
def func(x, y):
global result
if x < y:
print(x + y)
else:
print(x - y)
# Describe this function...
def mathfuc(y, x):
global result
if x < 0:
return y - x
return x + y
func(2, 3)
result = mathfuc(10, 5)
def func(x, y):
global result
if x < y:
print(x + y)
else:
print(x - y)
没有
返回值def mathfuc(y, x):
global result
return x + y
有
返回值if x < 0:
return y - x