Skip to content

Instantly share code, notes, and snippets.

@thblckjkr
Created May 19, 2019 22:30
Show Gist options
  • Save thblckjkr/ea79466683fa9860470928d346697085 to your computer and use it in GitHub Desktop.
Save thblckjkr/ea79466683fa9860470928d346697085 to your computer and use it in GitHub Desktop.
Just a simple python script for a homework
import math
times = [1000, 60000, 3600000, 86400000, 2592000000, 31104000000, 3110400000000]
for n in times:
print("\nCunando n= \t", n)
print ("lg(n)= \t\t", math.log(n, 2))
print ("sqr(n)= \t", math.sqrt(n))
print ("n lg(n)= \t", ( n *math.log(n, 2) ) )
print ("n ^2 = \t", n**2 )
print ("n ^3 = \t", n**3 )
print ("2^n = \t", 2**n )
print ("n! = \t", math.factorial(n) )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment