pythOn for循环

时间:2020-07-16 12:19:24   收藏:0   阅读:59

pythOn for循环

例题4-2

animals = [‘pig‘,‘dog‘,‘cat‘]
for animal in animals:
    print(‘A ‘ + animal + "would make a great pet")
print(‘Any of these animals would make a great pet!‘)

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!