CSS Ribbon

Reproducing the GitHub Ribbon in CSS

Python——Day2(笔记代码)

# test = "大pandaboy"
# v=test.capitalize()#首字母大写,当为汉字时失效
# print(v)
#######################################################################################
# test ="paNdaboy"
# # v=test.capitalize()#有方法的必须带括号,首字母大写
# # print(v)
#######################################################################################
# v1=test.casefold()#所有的都变小写,许多未知的对相应的变为小写
# print(v1)
#######################################################################################
# v2=test.center(20,"^")#一共10个位置,将字符串放中间,不写则空白填充,只能写一个字符
# print(v2)
#######################################################################################
# v3=test.count("a")#
# print(v3)
#######################################################################################
# v4=test.find("o")#从前往后开始找,找到后就停下
# print(v4)
#######################################################################################
# test = "PandaBoy"
# v=test.casefold()#大写字母转换为小写
# print(v)
#######################################################################################
# test = "pandaboy"
# v= test.center(20,'&')#使输出的字符放在中间,并用一个char填充剩余的宽度,不写则按照空格填充
# print(v)
#######################################################################################
# test= "pandaboy"
# v= test.count("a",2,6)#判断字符串中是否包含选择字符的个数
# print(v)
#######################################################################################
# test = '0aaaa'
# v= test.encode("utf-8")#转换utf-8的格式的字符转换为二进制
# print(v)
#######################################################################################
# test ="pandaboy"
# v= test.endswith("y")#是否按照提供的字符串做结尾
# print(v)
#######################################################################################
# test = "pandaboy\t"
# v= test.expandtabs()#方法把字符串中的 tab 符号('\t')转为空格,tab 符号('\t')默认的空格数是 8。
# print(v)
#######################################################################################
# test = "pandaboy"
# v=test.find("a",2,10)#查找是否包含提供的字符串,如果包含则输出第一次找到的字符串的索引值
# print(v)
#######################################################################################
# test = "pandaboy is {}"
# v = test.format('smart')#自定义字符串格式化
# print(v)
#######################################################################################
# str = "-"
# test = "pandaboy","public"#用于将序列中的元素以指定的字符连接生成一个新的字符串
# print (str.join(test))
#############################7个基本语法################################
# join
# split
# find
# strip
# upper
# lower
# replace
#############################6个特殊语法################################
# 1.索引下标获取字符串中的某一个字符
# test = "pandaboy"
# v = test[4]
# print(v)
# 2.索引下标获取字符串中的多个字符范围
# test = "pandaboy"
# v= test[0:7]#范围表示取0至7,切片表示法
# print(v)
# 3.统计字符串的长度len
# test = "pandaboy"
# v=len(test)#len获取当前的字符串有几个字符
# print(v)
# 4.计算列表的元素个数
# test = ['a','b','c','d','e']
# v= len(test)
# print(v)
# pandaboy=[11,22,33,44,55,"随便什么"]
# print(len(pandaboy))#获取列表中的字符串的长度
# 5.单个输出字符串(for)循环
# for test in "pandaboy":
# print ("当前字母:",test)
# for 变量名 in 字符串:
# 变量名
# 6.字符串的叠加
# name = "pandaboy"
# age = "25"
# test = name + age
# print(test)
################################特殊规则######################################
# 字符串一旦创建就不可修改
# 一旦修改或者拼接,都会造成重新生成字符串
# v=range(0,100,5)#实际不创建,内存占用率较小,帮助创建连续的数字、创建根据步长确定不连续的数字
# print(v)
# for item in v:
# print(item)
# test = input(">>>")
# for item in test:
# print(item)
#将文件按照索引打印出来
# test = input(">>>>")
# for item in range(0,len(test)):
# print(item,test[item])

posted on   pandaboy1123  阅读(170)  评论(0编辑  收藏  举报

编辑推荐:
· SQL Server 2025 AI相关能力初探
· Linux系列:如何用 C#调用 C方法造成内存泄露
· AI与.NET技术实操系列(二):开始使用ML.NET
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
阅读排行:
· 阿里最新开源QwQ-32B,效果媲美deepseek-r1满血版,部署成本又又又降低了!
· SQL Server 2025 AI相关能力初探
· AI编程工具终极对决:字节Trae VS Cursor,谁才是开发者新宠?
· 开源Multi-agent AI智能体框架aevatar.ai,欢迎大家贡献代码
· Manus重磅发布:全球首款通用AI代理技术深度解析与实战指南
< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

导航

统计

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