python

Python中坐标函数是哪个

九三
1226
2021-02-23 15:25:27
栏目: 编程语言
Python开发者服务器,限时0元免费领! 查看>>

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))

亿速云「云服务器」,即开即用、新一代英特尔至强铂金CPU、三副本存储NVMe SSD云盘,价格低至29元/月。点击查看>>

相关推荐:python中什么是函数

0
看了该问题的人还看了