扫描二维码下载沐宇APP

沐宇

微信扫码使用沐宇小程序

沐宇

Python中坐标函数是哪个

扬州沐宇科技
2021-02-23 15:25:27
python

Python中坐标函数是哪个

Python中一般使用coordinate函数定义坐标,使用方法如下:

def coordinate(x, y):

return {

(True, True ) : 1,

(True, False) : 2,

(False, True ) : 3,

(False, False) : 4

}[(x > 0, y > 0)]

if __name__ == "__main__":

print 'Please insert X,Y'

x = input('Please insert X')

y = input('Please insert Y')

print coordinate(float(x), float(y))

扫码添加客服微信