运行流程没有搞懂
s = input("请输入一个字符串:")res = []
for each in s:
if res and res[-1].lower() == each.lower() and res[-1] != each:
res.pop()
else:
res.append(each)
for each in res:
print(each, end='')
课后练习字符串I
if res and res[-1].lower() == each.lower() and res[-1] != each:
这句话我没读懂,不知道是怎么个运行流程。求大佬讲解
知道什么意思,但怎么运行没搞懂 小甲鱼讲短路逻辑:https://fishc.com.cn/forum.php?mod=viewthread&tid=150253&highlight=%B6%CC%C2%B7%C2%DF%BC%AD
页:
[1]