Mar-01-2018, 02:07 AM
#!usr/bin/env python3 #ufunc0.py import sys def word2(a): a1= a+a print(a1) return a1 while True: move = input('\'g\' to start\nsomethingelse to quit >> ') move = move.lower().strip() if move != 'g': sys.exit() else: word = input('enter 1 word.') word = word.lower().strip() word2(word) print(a1)my understanding of return is that once I return a variable it should be usable outside. Regarding my last line, what am I getting wrong...(it really shouldn't need to be defined outside the function). It's in memory, no?