趣学python3(4)-数字,字符串,列表(1)
生活随笔
收集整理的這篇文章主要介紹了
趣学python3(4)-数字,字符串,列表(1)
小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
1、數(shù)字
普通除法
print(7/3)
2.3333333333333335
地板除
print(7//3)
2
取余
print(7%3)
1
乘法
print(7*3)
21
乘方
print(3**3)
27
四則運(yùn)算
-4
2 、字符串
單引號(hào)和雙引號(hào)作用一樣
print(‘hello’)
print(“hello”)
print("‘hello’")
hello
hello
‘hello’
將轉(zhuǎn)義符原樣輸出
print(r"hello\nworld")
hello\nworld
print(“hello\nworld”)
hello
world
3、列表
總結(jié)
以上是生活随笔為你收集整理的趣学python3(4)-数字,字符串,列表(1)的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: 阿里RocketMQ Quick Sta
- 下一篇: 趣学python3(5)-数字,字符串,