I have some code to test other codes that I've written(in ipython notebook).
print_closest = lambda w, wl: print('{}: {} ({})'.format(w, *closest_match(w, wl)))
This is the code I have and it works on python 3 environment. However, it doesn't work on python 2.7. Instead, it throws an error below.
print_closest = lambda w, wl: print('{}: {} ({})'.format(w, *closest_match(w, wl)))
^
SyntaxError: invalid syntax
I'd like to make a change on the code above in order to get it work on python2.7 environment as well as python3.
Can anyone please tell me how? Thanks in advance.