Skip to content

Instantly share code, notes, and snippets.

View kristaph's full-sized avatar

Kristaps Gailis kristaph

View GitHub Profile
@kristaph
kristaph / project_multiplication_table.py
Last active August 29, 2015 14:06
project_multiplication_table
__author__ = 'Kristaph'
"""
http://redd.it/2agwnq
You remember those multiplication tables from elementary school, right? The ones where you choose a number on the
top row and one on the side and see where they meet on the chart? Good. It would be easy enough to just write it
out, but let's try using Python to our advantage.
Goal
Create a program that prints out a multiplication table for the numbers 1 through 9. It should include the numbers
1 through 9 on the top and left axises, and it should be relatively easy to find the product of two numbers. Do
not simply write out every line manually (ie print('7 14 21 28 35 49 56 63') ).
def parse_datetime(d):
"""
Datetime parser
Creates datetimes from input into format yyyy-mm-dd hh:mm:ss
Needs proper validation!
Should accept following:
yyyy