how to split a string into two strings python

Solutions on MaxInterview for how to split a string into two strings python by the best coders in the world

showing results for - "how to split a string into two strings python"
Delfina
05 Oct 2016
1# Python3 code to demonstrate working of
2# Splitting string into equal halves
3# Using string slicing
4
5# initializing string
6test_str = "GeeksforGeeks"
7
8# printing original string
9print("The original string is : " + test_str)
10
11# Using string slicing
12# Splitting string into equal halves
13res_first, res_second = test_str[:len(test_str)//2],
14						test_str[len(test_str)//2:]
15
16# printing result
17print("The first part of string : " + res_first)
18print("The second part of string : " + res_second)
19
queries leading to this page
how to split a string into two python at a certain charactersplit string python 2python split by two string orsplit on two or more strings pythonsplit string in steps of two pythonpython split string by two thingssplit string into 2 parts pythonhow to split a string in two pythonsplit string value into two values in python python split a string into two variablessplit a string to 2 line pythonsplit string into 2 stringssplit string python and get 2 elementspython separate string by 2python split string in multiple stringssplit sentence into two string pythonpython split between two stringshow to split a string into two strings pythonpython split string into two variablessplit string into multiple strings pythonsplit a string in two pythonsplit string into two parts pythonsplit a sentence into 2 strings pythonhow to split a string into two strings via delimiterhow to split a string into two pythonsplit a string into two strings pythonsplit string in 2 pythonhow to split a string into 2 parts in pythonpython split string by two delimiterssplit string of length 2 into 2 strings pythonhow to split string into two in pythonhow do you split a string into two strings in python 3fsplit string of length 2 into 2 parts pythonsplit with different string in pythonsplit string into two strings pythonhow to split a string into 2 strings in pythonhow to split a string in two strings via delimiters pythondivide string into two strings pythonsplit string in two pythonpython split string in 2 partshow to split a string at two values in pythonsplit by two words in string pythonhow to split a string into two stringssplit at multiple strings pythonsplit a string into multiple strings pythonpython split a string in twopython split string into two linesplit string into two pythonpython split by two strings orhow to split string at two things pythonhow to split a string into two wordsin pythonpython split on two stringssplit a string into two equal substrings pythonsplit a string into two stringshow to split a string in 2 in pythonhow to split a string into two strings python