摘要:
备注:列表元素索引下限从0开始,列表用[ ]表示 阅读全文
摘要:
备注:#用来注释代码,#后面的内容会被python解释器忽略 阅读全文
摘要:
#!/usr/bin/python #coding=utf-8 i=1.0 j=3 print(i*j) print(i+j) print(i**j) 备注:无论是哪种运算,只要有操作数是浮点数,python默认得到的都是浮点数,结果也总是浮点数 阅读全文
摘要:
#!/usr/bin/python #coding=utf-8 i=1 j=3 print(i*j) print(i**j) 阅读全文
摘要:
#!/usr/bin/python #coding=utf-8 message="python" print(message) print("\tpython") print("hello\npython\nhello\nworld") 阅读全文
摘要:
#!/usr/bin/python #coding=utf-8 first_name='tiger' last_name='gao' full_name= f"{first_name} {last_name}"--f为format的缩写 print(full_name) print(full_nam 阅读全文