- 帖子
- 25
- 精华
- 0
- 积分
- 72
- 阅读权限
- 20
- 注册时间
- 2018-4-5
- 最后登录
- 2018-10-21
|
这是看了看大家的代码,得到的灵感,还可以练练函数~- def quadrant(x,y):
- if x>0:
- if y>0:
- print('First quadrant')
- elif y<0:
- print('Fourth quadrant')
- else:
- print('The number is in active abscissa')
- elif x<0:
- if y>0:
- print('Second quadrant')
- elif y<0:
- print('Third quadrant')
- else:
- print('The number is in negative abscissa')
- else:
- if y>0:
- print('The number is in active ordinate')
- elif y<0:
- print('The number is in negative ordinate')
- else:
- print('The center is waiting for you!!!')
- x=eval(input('please enter the abscissa'))
- y=eval(input('please enter the ordinate'))
- quadrant(x,y)
复制代码 |
|