Assume I have the following list:
foo = ['a', 'b', 'c', 'd', 'e']
what is the best way to fill a field by random values from above list?
I've written following code, but it doesn't work.
1. Adding this code to function tab:
import random foo = ['a', 'b', 'c', 'd', 'e'] def randomword(): return random.choice(foo)
2. Calling above function in Expression section:
QGIS Says: Expression is invalid.
Parser Error: syntax error, unexpected '(', expecting $end
Eval Error: No root node! Parsing failed?