上一页 1 ··· 6 7 8 9 10 11 下一页
摘要: 整数 举例:1,2,234,-123,0 类型:int 浮点型(小数): 举例:1.3,2.14,-2.34 类型:float 可用加+减-乘*除/ 运算可以用括号改变优先级 阅读全文
posted @ 2023-07-06 14:09 等风来lzd 阅读(69) 评论(0) 推荐(0)
摘要: 阅读全文
posted @ 2023-07-06 11:21 等风来lzd 阅读(7) 评论(0) 推荐(0)
摘要: 阅读全文
posted @ 2023-07-06 11:14 等风来lzd 阅读(16) 评论(0) 推荐(0)
摘要: 阅读全文
posted @ 2023-07-06 11:11 等风来lzd 阅读(19) 评论(0) 推荐(0)
摘要: 阅读全文
posted @ 2023-07-06 10:36 等风来lzd 阅读(11) 评论(0) 推荐(0)
摘要: 列表修改值 animals =["老虎","狮子","豹子","长颈鹿","大象"] print(animals) animals[0] = "东北虎" animals[2] = "猎豹" print(animals) 输出结果如下: ['老虎','狮子','豹子','长颈鹿','大象'] ['东北 阅读全文
posted @ 2023-07-06 10:32 等风来lzd 阅读(38) 评论(0) 推荐(0)
摘要: 列表用中括号 [ ] animals = ["老虎","狮子","豹子","长颈鹿","大象"] print(animals) #type 是数据类型 print(type(animals)) 结果: ['老虎', '狮子', '豹子', '长颈鹿', '大象'] <class 'list'> 阅读全文
posted @ 2023-06-29 17:27 等风来lzd 阅读(12) 评论(0) 推荐(0)
摘要: "my name is liming" "我的名字是李明" 'i come from china' '我来自中国' 双引号 单引号都可以 双引号中可以使用单引号、单引号中也可以使用双引号 但是双引号中使用双引号、单引号中使用单引号会报错 "my name is liming" 'i come fro 阅读全文
posted @ 2023-06-29 10:32 等风来lzd 阅读(35) 评论(0) 推荐(0)
摘要: int(x) 将x转换为一个整数 float(x) 将x转换为一个浮点数 str(x) 将对象x转换为字符串 # 将数字类型转换成字符串num_str = str(11) print(type(num_str),num_str)<class 'str'>11 阅读全文
posted @ 2023-06-26 17:41 等风来lzd 阅读(15) 评论(0) 推荐(0)
摘要: type(被查看类型的数据) # 方式1: 使用print直接输出类型信息 print(type("黑马程序员")) print(type(666)) print(type(11.345))<class 'str'><class 'int'><class 'float'> string_type = 阅读全文
posted @ 2023-06-26 16:23 等风来lzd 阅读(26) 评论(0) 推荐(0)
上一页 1 ··· 6 7 8 9 10 11 下一页