当前位置: 首页 > news >正文

温州营销网站公司电话wordpress全局透明主题下载

温州营销网站公司电话,wordpress全局透明主题下载,个人网站怎么做才能值钱,网站分为四个步骤开发建设目录 一、字符串1.1 在字符串中使用变量 二、列表2.1 遍历列表练习题代码 2.2 列表元素的插入和删除涉及方法练习题代码 2.3 组织列表涉及方法练习题代码 2.4 索引 参考书#xff1a;Python从入门到实践#xff08;第二版#xff09; 一、字符串 1.1 在字符串中使用变量 f… 目录 一、字符串1.1 在字符串中使用变量 二、列表2.1 遍历列表练习题代码 2.2 列表元素的插入和删除涉及方法练习题代码 2.3 组织列表涉及方法练习题代码 2.4 索引 参考书Python从入门到实践第二版 一、字符串 1.1 在字符串中使用变量 f “{ 变量名 }” f代表formatPython把花括号里的变量名替换为其值来设置字符串的格式。Python3.6引入 代码示例 first_name input(Your first name is: ) last_name input(Your last name is : ) full_name f{first_name} {last_name} print(fMy name is {full_name.title()})二、列表 2.1 遍历列表 练习题 将一些朋友的姓名存储在一个列表中并将其命名为names 。依次访问该列表中的每个元素从而将每个朋友的姓名打印出来。 代码 names [winnie,jack,lili,will,diana] for name in names:print(fHello, my name is {name.title()}) else:print(The list is overlooped)代码解释 使用for循环遍历列表中的所有信息使用format字符串形式输出字符串中的变量使用title方法对列表中的字母进行首字母大写 2.2 列表元素的插入和删除 涉及方法 append() : 在列表末尾添加元素insert() 在列表任意位置添加元素remove() 根据具体值删除元素del 语句 删除整个列别或某一元素pop() 弹出任意元素 练习题 代码 #3-4 names [diane,kalinda,alicia,will,peter,cary] for name in names:print(fDear {name.title()}, lets have a dinner together this evening.) num_guests len(names) print(fWe have invited {num_guests} guests now,) print(\n)#3-5 print(Ops! Peter is busy with his campaign so he cant joy the dinner.\n) names.remove(peter) names.append(zerk) for name in names:print(fDear {name.title()}, lets have a dinner together this evening.) num_guests len(names) print(fWe have invited {num_guests} guests now,) print(\n)#3-6 print(We can invite more guests now because I have found a bigger dinner table now.\n) names.insert(0,tom) names.insert(int(len(names)/2),mary) names.append(winnie) for name in names:print(fDear {name.title()}, lets have a dinner together this evening.) num_guests len(names) print(fWe have invited {num_guests} guests now,) print(\n)#3-7 print(Sorry, I can only invite 2 guests to joy the dinner.\n) while len(names)2:name names.pop()print(fDear {name.title()}, sorry for the change, we can have dinner the next time!) for name in names:print(fDear {name.title()}, you are still invited to the dinner tonight.) del names[0] del names[0] print(names)输出如下 Dear Diane, let’s have a dinner together this evening. Dear Kalinda, let’s have a dinner together this evening. Dear Alicia, let’s have a dinner together this evening. Dear Will, let’s have a dinner together this evening. Dear Peter, let’s have a dinner together this evening. Dear Cary, let’s have a dinner together this evening. We have invited 6 guests now Ops! Peter is busy with his campaign so he can’t joy the dinner. Dear Diane, let’s have a dinner together this evening. Dear Kalinda, let’s have a dinner together this evening. Dear Alicia, let’s have a dinner together this evening. Dear Will, let’s have a dinner together this evening. Dear Cary, let’s have a dinner together this evening. Dear Zerk, let’s have a dinner together this evening. We have invited 6 guests now We can invite more guests now because I have found a bigger dinner table now. Dear Tom, let’s have a dinner together this evening. Dear Diane, let’s have a dinner together this evening. Dear Kalinda, let’s have a dinner together this evening. Dear Mary, let’s have a dinner together this evening. Dear Alicia, let’s have a dinner together this evening. Dear Will, let’s have a dinner together this evening. Dear Cary, let’s have a dinner together this evening. Dear Zerk, let’s have a dinner together this evening. Dear Winnie, let’s have a dinner together this evening. We have invited 9 guests now Sorry, I can only invite 2 guests to joy the dinner. Dear Winnie, sorry for the change, we can have dinner the next time! Dear Zerk, sorry for the change, we can have dinner the next time! Dear Cary, sorry for the change, we can have dinner the next time! Dear Will, sorry for the change, we can have dinner the next time! Dear Alicia, sorry for the change, we can have dinner the next time! Dear Mary, sorry for the change, we can have dinner the next time! Dear Kalinda, sorry for the change, we can have dinner the next time! Dear Tom, you are still invited to the dinner tonight. Dear Diane, you are still invited to the dinner tonight. 2.3 组织列表 涉及方法 sort对列表排序sorted对列表暂时排序不改变原有顺序reverse翻转列表 练习题 代码 #3-8 travel [italy,france,america,spain,denmark] print(original:,travel) print(sorted:,sorted(travel)) print(after sorted:,travel) travel.reverse() print(reverse:,travel) travel.reverse() print(reverse again:,travel) travel.sort() print(sort:,travel) travel.sort(reverseTrue) print(sort reverseTrue:,travel)#3-9 names [diane,kalinda,alicia,will,peter,cary] print(The number of guests are %d. %len(names)) 2.4 索引 列表从前往后的下标从0开始从后往前的下标从-1开始
http://www.hkea.cn/news/14462645/

相关文章:

  • 人防网站建设最好的做网站的公司
  • 怎么做网站和艺龙对接wordpress下拉插件
  • 上海做网站设计公司ppt 做的最好的网站
  • 营销型网站设计公司wordpress 框架选择
  • 做网站公司上班违法吗适合个人公众号的名字
  • 湛江自做网站哈尔滨建设规划局网站
  • 南昌企业做网站scratch网站开发
  • 网站你们都知道较好的网站设计师培训学校
  • 网站建设有趣小游戏可视化网页设计软件
  • 闽候县建设局网站南阳医疗网站建设公司
  • 做网站需要营业执照嘛阿里云备案网站建设方案书模板
  • 学会建设网站必要性搜索引擎推广是什么
  • 产品如何做网站推广西安app制作开发公司
  • 重庆营销型网站随做的好凡科网 免费网站
  • 佛山企业网站建设渠道学校宣传栏版面设计
  • 电子商务网站建设规划范文wordpress设置网站地图
  • 点击网站首页域名又添加一个php网站接入支付宝
  • 学校网站建设意义yahoo提交网站入口
  • 做网站前产品经理要了解什么网站开发和企业级开发有什么区别
  • 大学生怎么做网站支付模块大同网站设计
  • 免费的图库网站北京比较好的互联网公司
  • 用asp做的网站如何运行交互式网站的发展
  • php彩票网站开发建立网站备案需要什么资料
  • 自己的网站怎么做淘宝联盟湖州网络推广公司
  • 云南建设监理协会网站智能建造师报名入口官网
  • 陕西建设部网站长沙商城网站建设
  • 做网站电话说辞app生成器手机版
  • 网站建设dede模板免费网站备案符号
  • 网站建设服务器域名微网站 建设方案
  • 网站后台管理界面模板易联网站制作