Chapter10:文件和異常 課後習題選作

10-3 訪客 :編寫一個程序,提示用戶輸入其名字;用戶做出響應後,將其名字寫入到文件guest.txt中。 代碼以下: with open('guest.txt','w') as fobj: name = input('Please input your name:') fobj.write(name) 執行過程 Please input your name:Jack guest
相關文章
相關標籤/搜索