time = 0
for number in range (1,10):
if number % 2 == 0:
print(number)
time += 1
print(f"we have {time} even numbers")
输出:
2
4
6
8
we have 4 even numbers
f"任意字符串 {变量} ":很好地连接了不同类型的变量。
不用再进行数值型和字符串之间的转换。
2022-09-15 09:29:49
time = 0
for number in range (1,10):
if number % 2 == 0:
print(number)
time += 1
print(f"we have {time} even numbers")
输出:
2
4
6
8
we have 4 even numbers
f"任意字符串 {变量} ":很好地连接了不同类型的变量。
不用再进行数值型和字符串之间的转换。
下一篇:CF#612(Div.2)