#from file mod.dbconnect.py
def dbtest():
print("The database health is good.")
def dbconnect():
print("The database is connected.")
def dbdisconnect():
print("The database has been disconnected.")
def dbversion():
print("The database version is 14.0.5.")
####################################
#The file calling it
import mod_dbconnect as a
def db():
a.dbtest()
a.dbconnect()
a.dbdisconnect()
a.dbversion()
var1 = db()
#The output on console
The database health is good.
The database is connected.
The database has been disconnected.
The database version is 14.0.5.
I thought variables were supposed to be stored in RAM and called as and when needed not act as a function in themselves? How to I store data from a function in a global variable and not have it auto output to screen?