03 2022 档案

摘要:姓名:将一些朋友的姓名存储在一个列表中,并将其命名为names。 依次访问该列表中的每个元素,从而将每个朋友的姓名都打印出来。 names = ['xiaoming', 'xiaohong', 'xiaozhang', 'xiaotong'] print(names[0]) print(names[ 阅读全文
posted @ 2022-03-30 23:04 NiceTwocu 阅读(93) 评论(0) 推荐(0) 编辑
摘要:#列表:列表由一系列按特定顺序排列而成的元素组成。 #用([])方括号来表示列表,并用逗号来分隔其中的元素。 bicycles=['trek','connondale','redline','specialized'] print(bicycles) #列表元素访问方式:告诉python该元素的位置 阅读全文
posted @ 2022-03-30 23:00 NiceTwocu 阅读(210) 评论(0) 推荐(0) 编辑
摘要:如何编写注释 在Python中,注释用井号(#)标识。井号后面的内容都会被Python解释器忽略 tuboshu 2022/3/30 #tuboshu 2022/3/30 print("学习如何编写注释 简洁 明了") 执行结果 学习如何编写注释 简洁 明了 进程已结束,退出代码为 0 阅读全文
posted @ 2022-03-30 18:25 NiceTwocu 阅读(29) 评论(0) 推荐(0) 编辑
摘要:编写4个表达式,它们分别使用加法、减法、乘法和除法运算,但结果都是数字8。 print(2*4) print(6+2) print(8//1) print(12-4) print(round(8 / 1)) 执行结果 8 8 8 8 8 进程已结束,退出代码为 0 最喜欢的数字:将你最喜欢的数字存储 阅读全文
posted @ 2022-03-30 17:46 NiceTwocu 阅读(65) 评论(0) 推荐(0) 编辑
摘要:个性化消息:将用户的姓名存到一个变量中,并向该用户显示一条消息。显示的消息应非常简单,如“Hello Eric, would you like to learn some Python today?”。 name = "Zxx" # 方法一 print("Hello"" " + name + ",w 阅读全文
posted @ 2022-03-30 12:39 NiceTwocu 阅读(118) 评论(0) 推荐(0) 编辑
摘要:个性化消息:将用户的姓名存到一个变量中,并向该用户显示一条消息。显示的消息应非常简单,如“Hello Eric, would you like to learn some Python today?”。 栗子 name = "Zxx" #方法一 print("Hello"" " + name+",w 阅读全文
posted @ 2022-03-30 12:30 NiceTwocu 阅读(174) 评论(0) 推荐(0) 编辑
摘要:撇号位于两个双引号之间,因此Python解释器能够正确地理解这个字符串: message="One of Python's strengths is its diverse community." print(message) 执行结果 One of Python's strengths is it 阅读全文
posted @ 2022-03-29 23:24 NiceTwocu 阅读(139) 评论(0) 推荐(0) 编辑
摘要:rstrip():删除字符串末尾空白 first_name="tuboshu " print(first_name) print(first_name.rstrip()) first_name=first_name.rstrip() print(first_name) lstrip():删除字符串行 阅读全文
posted @ 2022-03-29 23:16 NiceTwocu 阅读(34) 评论(0) 推荐(0) 编辑
摘要:\t 在字符串中添加制表符 点击查看代码 print("python") print("\t python") 执行结果 点击查看代码 python python \n 在字符串中添加换行符 点击查看代码 print("languages:\nPython\nc\njavaScript ") 执行结 阅读全文
posted @ 2022-03-29 23:08 NiceTwocu 阅读(58) 评论(0) 推荐(0) 编辑
摘要:字符串就是一系列字符。在Python中,用引号括起的都是字符串,其中的引号 可以是单引号,也可以是双引号 title() :以首字母大写的方式显示每个单词,即将每个单词的首字母都改为大写。 点击查看代码 name = "cy lovelace" print(name.title()) 全部 uppe 阅读全文
posted @ 2022-03-29 15:16 NiceTwocu 阅读(28) 评论(0) 推荐(0) 编辑
摘要:一、Fixture固件 部分用例之前或之后执行,部分类之前或之后执行。模块或会话之前或之后的操 作。 Fixture完整的方法如下: @pytest.fixture(scope="作用域",params="数据驱动",autouse="是否自动执 行",ids=“参数别名”,name="Fixtur 阅读全文
posted @ 2022-03-13 19:00 NiceTwocu 阅读(37) 评论(0) 推荐(0) 编辑
摘要:一、Pytest详解以及常用的插件安装 1.pytest是一个非常成熟的基于python的单元测试框架(测试的是程序的最小单元:函 数,方法) python:unittest和pytest java: junit和testng 2.pytest可以和所有的自动化测试工具或模块:selenium,re 阅读全文
posted @ 2022-03-13 18:18 NiceTwocu 阅读(69) 评论(0) 推荐(0) 编辑
摘要:package com.company; public class Data02 { public static void main(String[] args) { System.out.println(1024);//这是一个整数,默认就是Int类型 System.out.println(3.4 阅读全文
posted @ 2022-03-10 23:12 NiceTwocu 阅读(18) 评论(0) 推荐(0) 编辑
摘要:package com.company; public class Main {//定义一个类 public static void main(String[] args) {//定义一个主函数 // write your code here System.out.println("Hello ba 阅读全文
posted @ 2022-03-10 22:14 NiceTwocu 阅读(21) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示