#! /usr/bin/python

x = input('please input a integer:')
x = int (x)

if (x < 0 ):
        print('你输入了一个负数')
else:
        print('你输入了一个0或正数')

 

[root@localhost pythonTest]# ./test1.py 
please input a integer:-1
你输入了一个负数
[root@localhost pythonTest]# ./test1.py 
please input a integer:1
你输入了一个0或正数
[root@localhost pythonTest]# 

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-06-13
  • 2021-10-24
  • 2022-12-23
  • 2021-11-12
  • 2022-12-23
猜你喜欢
  • 2021-09-23
  • 2021-07-01
  • 2021-08-13
  • 2022-01-22
  • 2021-11-24
相关资源
相似解决方案