python必背100行
s1=“”
print(bool(s1))#False
s1=“”
print(bool(s1))#True
name=input(“>>>”)
if name:
print(“666”)
else:
print(“333”)
print(str(True),str(False))#True False
print(type(True),type(False))#
s1=“python1期骑士计划”
s2=s1[0]
print(s2,type(s2))#p
s3=s1[-1]
print(s3)#划
s5=s1[0:6]
s6=s1[:6]
s7=s1[6:]
s8=s1[:5:2]
s9=s1[1::2]
print(s5)#python
print(s6)#python
print(s7)#1期骑士计划
print(s8)#pto
print(s9)#yhn期士划
name=“oldBay”
print(name.capitalize())#Oldbay
(20,“*”))#*******oldBay*******
print(name.upper())#OLDBAY
print(name.lower())#oldbay
username=input(“请输入用户名:”)
code=“ADfer”.upper()
your_code=input(“请输入验证码:”).upper()
if username==“alex”and your_code==code:
100个python练手项目
print(“账号密码及验证码输入正确”)
name=“pYtHon”
print(name.startswith(“o”))#False
print(name.startswith(“pY”))#False
print(name.startswith(“Y”,1))#True
print(name.startswith(“Yt”,1,5))#True
print(name.startswith(“pYtHon”))#True
dswith(“n”))#True

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。