python編程---example25

訪客名單: 編寫一個while循環,提示用戶輸入其名字。用戶輸入名字後,在屏幕上打印一句問候語,並將一條訪問記錄添加到文件guest_book.txt中。確保這個文件中的每條記錄都獨佔一行。 ui filename = 'guest_book.txt' while True: msg = "What is your name?\n" msg += "(Enter 'quit' to end.
相關文章
相關標籤/搜索