In the following string how can i split the string in the following manner
str1="hi\thello\thow\tare\tyou"
str1.split("\t")
n=1
Output=["hi"]
n=2
output:["hi","hello"]
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.
str.splithas an optional second argument which is how many times to split. We remove the last item in the list (the leftover) with the slice.For example: