Skip to content

Instantly share code, notes, and snippets.

@aphexmunky
Last active January 26, 2019 00:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aphexmunky/6e383270d930313beb17c3e31c3acf3c to your computer and use it in GitHub Desktop.
Save aphexmunky/6e383270d930313beb17c3e31c3acf3c to your computer and use it in GitHub Desktop.
Calculates the kardashev value for a civilisation given its power usage in watts
import math
def kardashev(p):
"""
Carl Sagans formula for determining the value intermediate kardashev scale value
Parameters:
p (int): the value in watts the civilisation uses
Returns:
float: the kardashev value for the civilisation
"""
return (math.log10(p) -6)/10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment