数字 1,加减乘除:+,-,*,/ 2,平方:** 3,立方:**3 4,字符串转换:str(数字) 5,浮点数:带小数点 0.2 Python编程建议 import this >>> import this The Zen of Python, by Tim Peters Beautiful is better than ugly. Explicit is better than implicit. Simple is better than complex. Complex is…
python学习1-字符串数字基本运算以及if条件和while循环 字符串表达形式共四种: name = "string" name = 'string' name = """string""" name = '''string''' 数字基本运算方式: a = 39 b = 4 c = a + b c = a - b c = a*b c= a**b #次幂 c = a/b c = a%b #取余数 c = a//b #取除数…
python学习心得第三章 1.三元运算 变量=值1 if 条件 else 值2 由图如果条件成立则赋值1给变量,如果条件不成立则赋值2给变量. 2.数据类型 集合:set() class set(object): """ set() -> new empty set object set(iterable) -> new set object Build an unordered collection of unique elements. "&quo…