Skip to content
Advertisement

Python: Making a multiple line user input to text file

How the heck can I do this… I’m New to Python and I’m trying to create a recipe catalog program to store all my recipes…

The ‘adding a recipe’ part of my code:

JavaScript

I just need the Multi-line user input…

EDIT: I need it to go into a .txt file

Advertisement

Answer

You can use iter(input, '') to accept input until a blank line:

JavaScript
User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement