As the title implies, this is my first little thingy i've written in Python wich isn't a example in the book i'm learning from.
Code: Select all
# Creepiness rule minimum dating age calculator
# Based on a xkcd comic - http://xkcd.com/314/
age = input("How old are you?\n")
minage = age / 2 + 7
print '\nThe age of your date should at minimum be:' + minage
(I know i could make it shorter, give me some advice, please?)
I don't think you need to import division
You can print a '\n' character and it adds an empty line.
And you can concatenate things with a '+' operator.
The raw_input() at the end probably stops the command line from closing on you, so maybe that's useful to you, but I removed it since I just call my scripts from command line. Try it with the raw_input if that doesn't work
I haven't tested this but I'm pretty sure it works.