I want to know how can we read multiple input like [“a”,”b”,”c”] and store it in same variable. I want to store a , b ,c as a separate input to a variable.
thanx
I want to know how can we read multiple input like [a,b,c] and store
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If you are actually getting input from stdin or from a file, then it is as easy as using the split() function
Of course, you could roll this into a single list comprehension:
I think that should work…I didn’t check it in an interpreter. The idea here is to give you an idea of how you can roll together Pythons very powerful list processing functions with its equally awesome string processing functions.
Remember, read documentation!
Good Luck!