json, similar interfaces exist for other formats like yaml, toml, ...seq.count(item) returns the number of elements with the specified value
'green banana'.count('na') returns 2
seq.index(item) returns the position of the first match
'green banana'.count('na') returns 8
from google.colab import files
files.download('/content/spec.txt')
text_from_url)
text_from_url
index
I have prepared a text file extracted from the duolingo wiki for Czech. The file is at skill0.txt (it was made using extract.py --- README, URLs).
skill0.txt and extract the vocabulary. The result should be a list of dictionaries, with each dictionary representing a word. The dictionary should indicate which lesson a word was in, the Czech word, and a list of English translations. For example, the first word in the first lesson is::
json.dump/json.dumps optional parameters:
indent = 2 formats it nicely,
ensure_ascii = False allows it to use unicode.
Start on project 1!
LAC: Language and the Computer Francis Bond.