《笨方法學python》 習題1

2021-08-21 17:38:11 字數 693 閱讀 4993

習題1 第乙個程式

#!usr/bin/python

#--coding:utf-8--

print

"hello world!"

print

"hello again"

print

"i like typing this."

print

"this is fun."

print

"yay! printing."

print

"i'd much rather you 'not'."

print

'i "said" do not touch this.'

執行結果:

hello world!

hello again

i like typing this.

this is fun.

yay! printing.

i'd much rather you 'not'.

i "said"

donot touch this.

其他:

建立資料夾:mkdir

進入乙個目錄:cd

列出資料夾的內容:ls

列印空行:print 『\n』*n;其中n代表行數

輸出不換行:在末尾加,

笨方法學Python 習題0

第一天學習,教材是中文第四版,完全零基礎 之前電腦上安裝了anaconda 所以現在是這個狀態,不知道python 3在之後的學習有沒有什麼問題,先這樣再說吧 ctrl z撤銷,回到python之前 windows裡terminal 就是指powershell 建立目錄 mkdir 進入目錄 cd ...

笨方法學python 習題4 5 6 7 8

習題4 space in a car中 car是假想空格字元 附加題 我的3的版本裡只用4沒有問題,我的猜想是2中如果除數都是int,答案會是去掉小數剩下的部分 比如說如果最後答案是3.75,python會顯示3,而實際上我們應該得出4這個答案,就不匹配了。是assignment,equal to ...

《 笨方法學 Python 》 習題 6 9

習題 6 字串和文字 x there are d types of people.10 binary binary do not don t 如果在字串中通過格式化字元放入多個變數,需要將變數放到 中,變數之間用逗號隔開 y those who know s and those who is s.b...