Use an array.
Bash has variable indirection, so you can say
for varname in train{1..20} do python something.py "${!varname}" done
! introduces indirection, so "get the value of the variable called the value varname"
But use an array. You can make the definition very readable:
trains=( path/to/first/file path/to/second/file ... path/to/third/file )
Note that this first index of the array is at position zero, therefore:
for ((i=0; i<${#trains[@]}; i++)); do echo "train $i is ${trains[$i]}" done
or
for idx in "${!trains[@]}"; do echo "train $idx is ${trains[$idx]}" done
source share