#! /usr/bin/env python # def l4_to_s ( l4 ): #*****************************************************************************80 # ## L4_TO_S converts an L4 to a string. # # Licensing: # # This code is distributed under the GNU LGPL license. # # Modified: # # 01 August 2016 # # Author: # # John Burkardt # # Parameters: # # Input, bool L4, a logical value. # # Output, string VALUE, the string. # if ( l4 ): value = 'True' else: value = 'False' return value def l4_to_s_test ( ): #*****************************************************************************80 # ## L4_TO_S_TEST tests L4_TO_S. # # Licensing: # # This code is distributed under the GNU LGPL license. # # Modified: # # 01 August 2016 # # Author: # # John Burkardt # print ( '' ) print ( 'L4_TO_S_TEST' ) print ( ' L4_TO_S converts an L4 to a string.' ) print ( '' ) print ( ' L4 S' ) print ( '' ) l4 = False s= l4_to_s ( l4 ) print ( ' %5s %s' % ( l4, s ) ) l4 = True s = l4_to_s ( l4 ) print ( ' %5s %s' % ( l4, s ) ) # # Terminate. # print ( '' ) print ( 'L4_TO_S_TEST' ) print ( ' Normal end of execution.' ) if ( __name__ == '__main__' ): from timestamp import timestamp timestamp ( ) l4_to_s_test ( ) timestamp ( )