标签:car equals string 关键字 nal 条件测试 if语句 实践 nbsp
#!usr/bin/python # _*_ coding:utf-8 _*_ motocycles = ["ducati","kawasaki","honda","bmws1000rr","cbr1000","suzuki"] car = "bmws1000rr" print("Is car == bmw s1000rr?,I predict is True") print(car == "bmws1000rr") print("\n car == dudi?I predict False") print(car == "audi") string_1 = "kawaski" string_2 = "honda" if string_1 != string_2: print("Yeah!") else: print("No,It equals it") string_3 = "ducati" if string_3 != "ducati": print("Yeah") else: print("No,It equals it") if string_1 and string_1 == "ducati": print("Yeah") else: print("No,It equals it") if string_1 or string_1 == "ducati": print("Yeah") else: print("No,It equals it") if string_3 in motocycles: print("Yeah") if string_3 not in motocycles: print("Yeah")
标签:car equals string 关键字 nal 条件测试 if语句 实践 nbsp
原文地址:https://www.cnblogs.com/2tomcat/p/12187062.html