Python入门习题大全——索引
你刚得知有位嘉宾无法赴约,因此需要另外邀请一位嘉宾。修改嘉宾名单,并欢迎新邀请的嘉宾。
# 修改嘉宾名单
people = ['ling', 'hui', 'he']
print('ling has an emergency.')
people[0] = 'zero'
print(people[0] + ", " + 'welcome to my house!')
输出为:
ling has an emergency.
zero, welcome to my house!