1

right, one thing i couldnt find about is feeding input directly into an int array

i've tried

inp = raw_input("Enter input").split(",")

doesn't do much but to print a single string without any separation

advice very welcomed

0

1 Answer 1

3

You could use map:

inp = raw_input('Enter input: ')
ints = map(int, inp.split(','))

Example

>>> inp = raw_input('Enter input: ')
Enter input: 5,4,3,2,1
>>> map(int, inp.split(','))
[5, 4, 3, 2, 1]
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.