본문 바로가기
Python/왕초보를 위한 파이썬

Python 실습_Character Replacement

by 가므자 2012. 4. 10.
Character Replacement
Create a method called replace() that takes a character and a string as parameters and returns a string with every instance of the character replaced with an asterisk (*). Ignore is characters are upper or lower case.

 

Results
Call Expected Received Correct
replace('b','bigboy') *ig*oy *ig*oy true
replace('c','CAT') *AT *AT true
replace('b','cat') cat cat true
 

'Python > 왕초보를 위한 파이썬' 카테고리의 다른 글

Python 실습_Replace at Index  (0) 2012.04.10
Python 실습_After Index  (0) 2012.04.10
Python 실습_Alphabet count  (0) 2012.04.10
Python 실습_Capitalize Even Items  (0) 2012.04.10
Python 실습_Range Step  (0) 2012.04.10

댓글