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