# -*- coding: GBK -*-
magicians = ['alice', 'david', 'carolina']
for magician in magicians: print(magician.title() + ", that was a great trick!")
print("I can't wait to seee your next trick," + magician.title() + ".\n")

输出为:

Alice, that was a great trick!
I can't wait to seee your next trick,Alice. David, that was a great trick!
I can't wait to seee your next trick,David. Carolina, that was a great trick!
I can't wait to seee your next trick,Carolina.

Python自学:第四章 在for循环中执行更多操作(2)的更多相关文章

  1. Python自学:第四章 在for循环中执行更多操作(1)

    # -*- coding: GBK -*- magicians = ['alice', 'david', 'carolina'] for magician in magicians: print(ma ...

  2. Python自学:第四章 在for循环结束后执行一些操作

    # -*- coding: GBK -*- magicians = ['alice', 'david', 'carolina'] for magician in magicians: print(ma ...

  3. Python自学:第四章 复制列表(1)

    # -*- coding: GBK -*- my_foods = ['pizza', 'falafel', 'carrot cake'] friend_foods = my_foods[:] prin ...

  4. Python自学:第四章 遍历切片

    # -*- coding: GBK -*- players = ['charles', 'martina', 'michael', 'florence', 'eli'] print("Her ...

  5. Python自学:第四章 切片

    # -*- coding: GBK -*- players = ['charles', 'martina', 'michael', 'florence', 'eli'] print(players[0 ...

  6. Python自学:第三章 弹出列表中任何位置处的元素

    motorcycles = ["honda", "yamaha", "suzuki"] first_owned = motorcycles. ...

  7. “全栈2019”Java第二十四章:流程控制语句中决策语句switch下篇

    难度 初级 学习时间 10分钟 适合人群 零基础 开发语言 Java 开发环境 JDK v11 IntelliJ IDEA v2018.3 文章原文链接 "全栈2019"Java第 ...

  8. 《Entity Framework 6 Recipes》中文翻译系列 (20) -----第四章 ASP.NET MVC中使用实体框架之在MVC中构建一个CRUD示例

    翻译的初衷以及为什么选择<Entity Framework 6 Recipes>来学习,请看本系列开篇 第四章  ASP.NET MVC中使用实体框架 ASP.NET是一个免费的Web框架 ...

  9. Netty源码分析第2章(NioEventLoop)---->第6节: 执行select操作

    Netty源码分析第二章: NioEventLoop   第六节: 执行select操作 分析完了selector的创建和优化的过程, 这一小节分析select相关操作 跟到跟到select操作的入口 ...

随机推荐

  1. VS系列远程调试

    其实很多时候,远程调试的话,我还是更喜欢用WinDBG的, 首先,可以练习WinDBG的使用手段, 其次,可以增加WinDBG的熟练度, 最重要的,WinDBG在内核调试部分很常用,我也很喜欢它,所以 ...

  2. Vue下渐变效果有时候失效

    记录一个问题:我在项目中给按钮设置一个渐变属性,调试的时候有时候有效果,有时候又没有,代码如下: .training-right-bmz { background: -webkit-linear-gr ...

  3. minicom 的使用

    1.切换到 root 用户. [root@localhost btools]#su - 2. 查找有效的串设备. [root@localhost ~]#cat /proc/devices ... 4 ...

  4. 支付宝支付接口-运行支付宝demo

    运行deme 提供了 支付  查询 退款 交易关闭几个简单的接口demo 下载 https://docs.open.alipay.com/270/106291/ 转为mave项目 1.创建一个空的ma ...

  5. wireshark 分析 TCP 请求(转)

    转自:http://supben.iteye.com/blog/2329780 先看一段代码  程序片段是一个RPC调用 ,根据简历id获取简历实体.本地IP 10.252.156.132, 远程ip ...

  6. 程序‘vim’已包含在下列软件包中

    解决方法: 输入:sudo apt-get install ctags 输入:sudo apt-get install vim 输入:sudo ./config.sh (亲测有效)输入:vim tes ...

  7. 配置类一@Configuration

    import org.springframework.context.annotation.Configuration; @Configuration用于定义配置类,可替换xml配置文件,被注解的类内 ...

  8. Android android studio常用的一些快捷键以及常用权限

    android studio的常用快捷键:一.打印log:1.输入logt回车:  自动生成TAG的全局变量:private static final String TAG = "MainA ...

  9. 【磁盘】顺序IO比随机IO快

    假设磁盘每秒可以做100个随机I/O操作,并且可以完成每秒10MB的顺序读取(这大概是消费级磁盘现在能达到的水平).如果每行100字节,随机读每秒可以读100行(相当于每秒10000字节=10KB), ...

  10. Python:Logging日志处理

    程序中,需要添加日志来记录大量信息. import logging # 第一步:创建logger self.logger = logging.getLogger() self.logger.setLe ...