# Python Day 1 Console Parentheses Strings Double quote “ Stack overflow 網站是所有開發者遇到問題時會去看的網站 ⌘(command)+Enter = Run print(“Hello world!\nHello world!” \n = separate Concatenate print('String Concatenation is done with the "+" sign.') 會跑出String Concatenation is done with the "+" sign. 1-9 print(“Hello “ + input(“What is your name?”)) 會變成 What is your name? (然後這邊你打Angela) 會跑出 Hello Angela Input(“A prompt for the user”) A prompt for the user (然後後面會有游標要你打上回答) 如果覺得input function很難,可以去thong.org 貼上code,他會拆解code指令的步驟 #加上這個可以寫comment Command +/ 可以highlight a line of code 把它變成註解 Command + z 可以undo a highlight line of code A function that calculates the length of a sting 可以在google上搜尋 “How to get the length of a string in python stack overflow” len() function可以計算字串字數 print(len(input("What is your name? "))) 也可以用空格隔開 因為有三個公式在裡面 這樣會比較清楚 print( len( input("What is your name? ") ) ) 運用變數的話也可以這樣寫  變數(Variable)是什麼?從字面上解釋,變數就是「可變的數」,也就是其值可以隨著時間而改變。假如用更精確的說法來解釋,程式設計上的變數,代表的就是一個擁有名稱的記憶體儲存空間。 Name= input(“What is your name? ”) length = len (name) print(length) 如果要把咖啡和牛奶對換,會拿第三個杯子來換,所以才會有C a = input("a: ") b = input("b: ") c = a a = b b = c print("a: " + a) print("b: " + b) ————————————— print("Hello welcome to the band name generator.") city= input("What name of the city you grew up in?\n") pet= input("What your pet's name?\n") print("Your band name could be " + city + " " + pet) 會變成 Hello welcome to the band name generator. What name of the city you grew up in? Hsinchu What your pet's name? Nicole Your band name could be Hsinchu Nicole