Fun with python

I have been learning python via numerous resources, codeacademy and more recently with the ubuntu full circle special edition, issue 1 course on python. (see my programming section for links etc)

Thus far with some help from Tom Brough I have come up with this., its not much it takes input as 2 strings, and does various things with them. and also works out my age from entering my year of birth and subtracting this from the current year.

One of the advantages with using different resources is that you can experiment and try and improve software as you go along,

for example I have modified the dragon.py program as found in the inventwithpython book and changed the input method to raw_input, this gets round having to use quotes “” when entering the cave number.
import random
import time

def displayIntro():
print(‘You are in a land full of dragons. In front of you,’)
print(‘you see two caves. In one cave, the dragon is friendly’)
print(‘and will share his treasure with you. The other dragon’)
print(‘is greedy and hungry, and will eat you on sight.’)
print(‘enter responses in quotes ” ” ‘)
print()

If you are using codeacademy then the PySchools Quick Reference website is a good way to remember some of the concepts being taugth print pages off for future reference or just save them somewhere, just don’t open the page and end up closing the code academy page at the same time.