assigning string with boolean expression,openmode = 'w'