How to subtract two outputs in python

I am using Google Co lab I want to subtract two outputs ayanamsha-position of sun and moon. Output should be like this.

  1. 23.381658282103217- 267.0822930016132 = 243.70063472
  2. 23.381658282103217- 224.3827740603826 =201.00111578
!pip install pyswisseph
!wget.http://www.astro.com/ftp
/sw isseph/ephe/seas_18.se1

!wgethttp://www.astro.com
/ftp/swisseph/ephe/semo_18.se1

!wget.http://www.astro.com/ftp
/swisseph/ephe/sepl_18.se1

!mkdir ephe
!mv *.se1 ephe

import swisseph as swe

# Date & Time of Birth
# Convert UTC date to Julian.   
Date
JD = 
swe.utc_to_jd
(1965,12,19,4,56,0,gregflag)
# JD[0] is Ephemeris Time
# JD[1] is Universal Time 
natalUT = JD[1]

natalLON = 88.35
natalLAT = 22.55

#Ayanamsha
ayanamsha = 
swe.get_ayanamsa(natalUT)
print('Lahiri Ayanamsha :', 
ayanamsha)
    
#Lahiri.Ayanamsha:
23.381658282103217

# body 0 = Sun, 1 = Moon, ... 
11 = True Node (Rahu)
bLon = []
bRet = []

for body in [0,1]: pData = swe.calc_ut (natalUT,body,iflag) #print(pData[0])
--- this is a major change #print(pData[1])
--- this is a major change bLon.append(pData[0][0])
# note this correction if pData[0][3] >= 0:
# note this correction bRet.append('False') else : bRet.append('True') for ix in range(len(bLon)) : print(bLon[ix], bRet[ix])

#267.0822930016132 False
#224.3827740603826 False


Read more here: https://stackoverflow.com/questions/67920233/how-to-subtract-two-outputs-in-python

Content Attribution

This content was originally published by user9244754 at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: