#!/usr/bin/env python3
#=====================================================================================
# Python variable output to html page 
#=====================================================================================
print("Content-Type: text/html \n")     #http header with newline char (required for web)


x    = 5                                        #create an integer variable
y    = 6.3                                      #create a floating point decimal variable
ok   = True                                     #create a Boolean variable
name = 'Sam Sultan'                             #create string variable

print('<pre>')                                  #to print better on the web

print('The variables and their types are:')  
print(x,    '\t\t', type(x))
print(y,    '\t\t', type(y))                                       
print(ok,   '\t\t', type(ok))                                          
print(name, '\t',   type(name))                                        
print()

print('Mathematically: ', end='')               #notice the end='', it means do not skip to next line
print(str(x) + ' * ' + str(y) + ' =', x*y)      #using str(), otherwise cannot concatenate                                                      

print('Mathematically: ', end='')               
print(F"{x} * {y} = {x*y} ")                    #an easier way to write the above 2 statements                     
print()

print('String Concatenation: ', end='')
name = name + ' Jr.'
print(name)



#=== link to see the python code =================================================
import os, sys
sys.path.insert(0,'/home/s/sultans/web/python/demo')
import zCode                          #import func to display the Python code
filename = os.path.abspath(__file__)  #get absolute file name 
zCode.display(filename)               #call it
#=================================================================================