06/06 ๐Ÿ“– ํŒŒ์ด์ฌ ๋ฌธ์ž์—ด ํ•จ์ˆ˜ - (3)

Q) ๋ฌธ์ž์—ด ํ•จ์ˆ˜ ์ค‘ replace ํ•จ์ˆ˜์™€ split ํ•จ์ˆ˜๋ฅผ ์ด์šฉํ•˜์—ฌ str1๋ฌธ์ž์—ด์„ str_list๋กœ ๋ฐ”๊ฟ”๋ณด์„ธ์š”.

str1 = ' one to two to three to four '

str1 = str1.replace('one', '1').replace('two', '2').replace('three', '3').replace('four', '4')
str1.split('to')

์ข‹์€ ์›นํŽ˜์ด์ง€ ์ฆ๊ฒจ์ฐพ๊ธฐ