Skip to content

Instantly share code, notes, and snippets.

@bark
Created August 1, 2014 18:01
Show Gist options
  • Save bark/2f96d9bbb72c15173d2c to your computer and use it in GitHub Desktop.
Save bark/2f96d9bbb72c15173d2c to your computer and use it in GitHub Desktop.
pyhton exempel 2
def square(n)
squareNum = n**2
if squareNum==4 #ogiltig siffra sicka error
return -1
return squareNum
if square(2) != -1
print "square %d " % (square(2)
else
print "error värden kommer gå under"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment