print()函数应用中的一个问题
在小甲鱼Python 0基础的009讲的课后题中有一行语句是为了打印出有‘*’号在密码中时可以再次输入密码我写的语句是 print(''*'is not in password,you have another', count, 'times.')是报错的
但是 print('"*"is not in password,you have another', count, 'times.')却是正确的
请问在单引号中套用单引号违反规则吗? 你这个肯定错啊,print(''*'is not in password,you have another', count, 'times.'),“”要对应啊,要么就是单引号,要么就是双引号,你一会双一会单肯定报错啊, 单引号中只能套双引号
双引号中只能套单引号
页:
[1]