将字符串 "example" 中的字母 a 替换为字母 b,以下代码正确的是?
A. example.swap('b', 'a')
B. example.replace('a', 'b')
C. example.match('b', 'a')
D. example.replace('b', 'a')
Python 中,以下哪个代码是正确的列表?
A. sampleList = {1,2,3,4,5}
B. sampleList = (1,2,3,4,5)
C. sampleList = /1,2,3,4,5/
D. sampleList = [1,2,3,4,5]