1、判断元组中是否存在指定值
确定元组中是否存在指定的值,请使用in
关键字:
例如:
检查元组中是否存在"python":
thistuple = ("c", "java", "python")
if "python" in thistuple: print("Yes, 'python' is a programming language")
相关文档:
确定元组中是否存在指定的值,请使用in
关键字:
例如:
检查元组中是否存在"python":
thistuple = ("c", "java", "python")
if "python" in thistuple: print("Yes, 'python' is a programming language")
相关文档: