Skip to content

Instantly share code, notes, and snippets.

@j-faria
Created November 23, 2016 17:37
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 j-faria/3c642e1fa69b00653a608232d86dffe6 to your computer and use it in GitHub Desktop.
Save j-faria/3c642e1fa69b00653a608232d86dffe6 to your computer and use it in GitHub Desktop.
Special function for Vardan
def fun(teff=None, mass=None):
if teff and mass:
# gave two parameters
pass # goto 1
elif teff:
# don't have mass, have teff
mass = f(teff)
elif mass:
# don't have teff, have mass
# teff = f(mass)
# (1)
# you have both teff and mass defined
fun(2., 1.) # teff=2, mass=1
fun(teff=2., mass=3.) # teff=2, mass=3
fun(mass=4., teff=0.) # ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment