Python Tricks #24 - Taking a string input

in #programming5 years ago
# For example "1 2 3 4" and return [1, 2, 3, 4]

# Remember list being returned has integers in it.
# Don't use more than one line of code.

>>> result = map(lambda x:int(x) ,raw_input().split())
1 2 3 4
>>> result
[1, 2, 3, 4]

Coin Marketplace

STEEM 0.25
TRX 0.11
JST 0.029
BTC 69342.59
ETH 3678.52
USDT 1.00
SBD 3.35