Raspberry Pi for Beginners contains lots of practical code samples. In most cases, you’ll learn best by typing the code samples from the book but if, for whatever reason, you don’t want to do this, right-click the links below and select “Save link as” or similar…
fortunes=['Yes','Probably','Certainly','Outlook promising','Not sure','Ask again','Doubtful','No']
raw_input('Think of a question, press Enter for the answer')
This is a ZIP file containing two Python files so you must extract it before loading into Geany.
File object example
Demonstrates how to read from and save to a text file using the built-in Python File object.