# the print() function is a function that just does something and moves on - but it # hands back nothing (returns nothing to the user), therefore it hands back None. # print_return is assigned the value of the print function call # print_return = None # So when we print( print_return ), we print the value of print_return which is the # value of the function call which is None print_return = print( 'Clara' ) # It does print Clara (what the function print does) # but the function call hands back None so None is stored in print_return print( print_return ) x = [] x = x.append( 1 ) # Don't do this! print( x ) y = [] y.append( 1 ) print( y ) # Again, append() hands back None # The point of append() is just to add the thing in parentheses to the list but it # hands back None (just adds it and moves on) # So when we do x = x.append( 1 ) # We're doing x = None # Therefore, x is None. # So just call x.append(1) not x = x.append(1) # Don't assign append() to a variable! (Refer to accumulator review for examples!) # Just call listvariable.append( x ) for the listvariable # and don't set it equal to a variable :) That's all for now. # Don't do listvariable = listvariable.append( x ) # Strings are IMMUTABLE - cannot be changed s = 'Apple' s.lower() # The original string s is unchanged print( s ) # 'Apple' t = s.lower() print( t ) # 'apple' # Lists ARE mutable - can be changed! list1 = [] list1.append( 'addme' ) print( list1 ) # ['addme'] s = 'apple banana cherry orange' fruits = s.split # No parentheses?? No longer calling the function on s and getting the value from s.split() print( fruits ) # fruits is now the function split being called on s but not the VALUE of s.split() # fruits is now an alias for s.split (but not the function call s.split()) # Remember parentheses on functions! Do s.split() not s.split