1.代码
代码如下:
x = int(input('请输入x的值:'))
y = int(input('请输入y的值:'))
if x > 0 and y > 0:
print('(x,y)属于第一象限')
elif x < 0 and y > 0:
print('(x,y)属于第二象限')
elif x < 0 and y < 0:
print('(x,y)属于第三象限')
elif x > 0 and y < 0:
print('(x,y)属于第四象限')
2.运行结果
D:\Python代码\Scripts\python.exe C:/Users/Lenovo/PycharmProjects/pythonFirstStart/实验二/demo3.py
请输入x的值:2
请输入y的值:-3
(x,y)属于第四象限
Process finished with exit code 0