電腦, Python, 未分類

Python-Day1-變數

https://replit.com/

print(“hello world") –> 印在螢幕上

print(“print(‘what you print’)") –> print 有雙引號的字串

print(“this is line 1\n this is line 2″) –> 換行符號

print(“Hello" + " Angela") –> 字串連接

#Write your code below this line 👇 –> 註解

print(“there are " + str(len(input(“input your name"))) + " characters") –> 字串長度/數字轉字串

name = “Jack" –> 變數

print(name)

=== 變數命名方式

使用底線分隔, 例如 user_name

發表留言