Python入门习题大全——索引
想想你喜欢的通勤方式,如骑摩托车或开汽车,并创建一个包含多种通勤方式的列表。根据该列表打印一系列有关这些通勤方式的宣言,如”I would like to own a Honda motorcycle“。
# 自己的列表
car = ['Benz E 300', 'Benz G 500', 'Camaro ZL11LE']
message = 'I would like to own ' + car[-1] + '.'
print(message)
输出为:
I would like to own Camaro ZL11LE.