I am making a program to make 12 word long phrases using the bip39 wordlist.
However with the code I wrote I am getting an error I do not know how to fix.
Code:
import requests
import random
r = requests.get("https://raw.githubusercontent.com/bitcoin/bips/master/bip-0039/english.txt")
def make_seed():
return "".join([random.choice(r.text.split("\n")) + " "] for i in range(12))
print(make_seed())
Output: TypeError: sequence item 0: expected str instance, list found
Expected output: 12 letter phrase from the wordlist.
I tried turing the random.choice(r.text.split("\n")) into a str but that doesn't seem to work.