the.bay.news

Exercise 10-5 'Guest Book', E.Matthes: Pyhton Crash Course, 2nd ed

Discussions on Python.org
Exercise 10-5 'Guest Book', E.Matthes: Pyhton Crash Course, 2nd ed
Hi! I was trying to solve exercise 10-5 in the book: Write a while loop that prompts users for their name. Collect all the names that are entered, and then write these names to a file called guest_book.txt. Make sure each entry appears on a new line in the file. It took me a while and at some point I checked for the solution given by the author from pathlib import Path path = Path('guest_book.txt') prompt = "\nHi, what's your name? " prompt += "\nEnter 'quit' if you're the last guest. " g...

0 comments

Sign in to join the discussion — your thebay.events account works here.

No comments yet.