摘要:
字符串的表示方式 在python里,可以使用一对单引号,一对双引号或者一对三个单引号,一对三个上引号 a = 'hello' b = "good" c = '''呵呵呵''' d = """嘿嘿嘿""" 如果字符串里有单引号,外面可以用双引号 e = '小明说:"你好"' f = "I'm xiao 阅读全文
摘要:
While语句的使用 循环就是让一件事情重复做多次,python里的循环分为while和for循环, python不支持do......while循环 python 里没有自增自减运算符 while循环的基本使用, while判断条件:条件成立时执行代码 x = 0 while x < 2: pri 阅读全文
摘要:
逻辑运算符 逻辑与and 逻辑或or 逻辑非not 逻辑与规则:只要一个运算数是False,结果就是False;只有所有的运算数都是True,结果才是True print(2>1 and 5>3 and 10>2) # result:True print(3>2 and 5<4 and 6>1) # 阅读全文