Created
September 10, 2012 06:45
-
-
Save rberaldo/3689282 to your computer and use it in GitHub Desktop.
That's my first exercise on I/O!
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def createBook(title,author,year): | |
outFile = open('database.txt', 'wt') | |
outFile.write("[book]\n") | |
outFile.write("title: " + title + "\n") | |
outFile.write("author: " + author + "\n") | |
outFile.write("year: " + year + "\n") | |
outFile.close() | |
print("Welcome to Shellf!") | |
print("Answer the questions to add your book do the database.") | |
title = input("Title: ") | |
author = input("Author: ") | |
year = input("Year: ") | |
print("Adding book...") | |
createBook(title,author,year) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment