#!/usr/bin/env python # encoding: utf-8 # # Copyright (c) 2010 Doug Hellmann. All rights reserved. # """Square roots """ #end_pymotw_header import math print math.sqrt(9.0) print math.sqrt(3) try: print math.sqrt(-1) except ValueError, err: print 'Cannot compute sqrt(-1):', err