You are viewing a single comment's thread. Return to all comments →
Wow, well said. I love how you coded this:
for i in map(int, input().split()): values['positive'*(not i) + 'negative'*(i<0) + 'zeros'*(i>0)] += 1
Edit: it seems like you made a mistake, if 'i>0' zeroes will increase with 1. if i=0 positive will increase with 1
You need to swap the statements 'not i' and 'i>0'
Seems like cookies are disabled on this browser, please enable them to open this website
Plus Minus
You are viewing a single comment's thread. Return to all comments →
Wow, well said. I love how you coded this:
Edit: it seems like you made a mistake, if 'i>0' zeroes will increase with 1. if i=0 positive will increase with 1
You need to swap the statements 'not i' and 'i>0'