标签:方法 运算符 count int name als while 运算 逻辑运算符
f=True
while f:
print(1)
print(2)
count = 1
while count <= 5:
print(count)
count += 1
count=5
while count:
print(count)
count-=1
while True:
print(1)
print(2)
break
print(3)
print(4)
1
2
4
while True:
print(1)
print(2)
continue
print(3)
print(4)
1
2
1
2
.
.
.
while True:
print(1)
break
else:
print(2)
print(bool(0))
a="name:"
b="age:"
c="job:"
d=input("名:")
e=input("龄:")
f=input("工:")
print(a+d+"\n"+b+e+"\n"+c+f)
m='''
name:%s
age:%s
job:%s
'''
a=input("名:")
b=input("龄:")
c=input("工:")
print(m%(a,b,c))
m='''
name:%s
age:%d
job:%s
'''
a=input("名:")
b=int(input("龄:"))
c=input("工:")
print(m%(a,b,c))
b=input("输:")
a="A层:"
print(a+b)
b=input("输:")
a="A层:%s"
print(a%(b))
a=f"A层{1}"
print(b)
b=input("层:")
a=f"A层{b}"
print(a)
a=10
a+=1
print(a)
a=10
a*=2
print(a)
print(0 and 1)
print(0 or 1)
print(9 and 1 or not False and 8 or 0 and 7 and False)
s="als"
print("ls" in s)
True
s="als"
if "ls" in s:
print(True)
else:
print(False)
True
标签:方法 运算符 count int name als while 运算 逻辑运算符
原文地址:https://www.cnblogs.com/-xct/p/11562935.html