题解 | #统计数据正负个数#
统计数据正负个数
http://www.nowcoder.com/practice/3f33889582934a09b4e3ddd3cc976226
a = list(map(int, input().split())) b = len([x for x in a if x > 0]) c = len([y for y in a if y < 0]) print('positive:%d\nnegative:%d' % (b, c))
统计数据正负个数
http://www.nowcoder.com/practice/3f33889582934a09b4e3ddd3cc976226
a = list(map(int, input().split())) b = len([x for x in a if x > 0]) c = len([y for y in a if y < 0]) print('positive:%d\nnegative:%d' % (b, c))
相关推荐
查看12道真题和解析