Concept:

使用變數操作資料

100 DAYS OF PYTHON

Day:1


Filename:

Coding Rooms

https://repl.it/@dngg6688/band-name-generator-start#main.py

#comments


print("Hello World! \\nHello World!\\nHello World!")
print('String Concatenation is done with the "+" sign.')

print(len('\\foo')) 

import sys
x = 'Sample String'

print(len(x))

print(sys.getsizeof(x))

print("Hello " + input("What's Your Name?")) 

\n 換行

字串串聯

len()取字串長度

3

sys.getsizeof(x) 傳回位元組數

13

62

input()輸入




repl的setting 裡面,Theme⇒dark Font size⇒large code intelligence⇒enabled

debug工具

Thonny

計算字串長度可參考,有其他相關用法

在 Python 中獲取字串的長度和大小

Python 儲存字串時是如何節省空間的?