python随机生成10个数 打印出最小的3个数_用python产生(-19,19)的随机数,print出最大的两负数和最小的两个正数。...

Sampleoutputs$pythonquiz_1.py0Thegeneratedlistis:[5,7,-17,-3,13,12,6,0,11,3]Thelargestandsecondlargeststrictlynegativeintegersare-3and-17.Thesmallestandsecondsmalleststri...

Sample outputs

$ python quiz_1.py 0

The generated list is: [5, 7, -17, -3, 13, 12, 6, 0, 11, 3]

The largest and second largest strictly negative integers are -3 and -17.

The smallest and second smallest strictly positive integers are 3 and 5.

$ python quiz_1.py 1

The generated list is: [-11, 17, -15, -3, -12, 12, 9, 11, 5, -6]

The largest and second largest strictly negative integers are -3 and -6.

The smallest and second smallest strictly positive integers are 5 and 9.

$ python quiz_1.py 2

The generated list is: [-16, -14, -14, 4, -9, 0, -3, 19, -6, 19]

The largest and second largest strictly negative integers are -3 and -6.

The smallest and second smallest strictly positive integers are 4 and 19.

$ python quiz_1.py 3

The generated list is: [-4, 18, 15, -11, 4, 19, 11, 18, -15, 19]

The largest and second largest strictly negative integers are -4 and -11.

The smallest and second smallest strictly positive integers are 4 and 11.

$ python quiz_1.py 4

The generated list is: [-4, 0, -13, 6, 11, -10, -14, -15, -18, 6]

The largest and second largest strictly negative integers are -4 and -10.

The smallest and second smallest strictly positive integers are 6 and 11.

$ python quiz_1.py 5

The generated list is: [-3, 3, 14, -18, 10, -4, -16, -9, -12, 4]

The largest and second largest strictly negative integers are -3 and -4.

The smallest and second smallest strictly positive integers are 3 and 4.

$ python quiz_1.py 13

The generated list is: [-3, -1, -8, -5, -10, -5, -8, -11, -15, 15]

The largest and second largest strictly negative integers are -1 and -3.

There is only one strictly positive integer, 15.

$ python quiz_1.py 61

The generated list is: [12, -8, 16, -6, 1, -1, 1, -18, 12, 3]

The largest and second largest strictly negative integers are -1 and -6.

The smallest and second smallest strictly positive integers are 1 and 3

展开

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值