My Code:
TypeErrorTraceback (most recent call last)
in ()
9 for app in ios:
10 name=ios[0]
—> 11 if is_english(name):
12 ios_english.append(app)
13
in is_english(string)
3
4 for character in string:
----> 5 if ord(character)>127:
6 non_ascii += 1
7
TypeError: ord() expected a character, but string of length 9 found
Other details:
I ran the code in the cell where you start by making a dictionary for english ios & android apps. The code eventually goes back one cell to run the function “is_english” and this is where the ios dataset runs into the error message mentioned above.
I don’t understand the error message. Isn’t the code supposed to check every character of the string, so why does it run into an error when confronted with a string (of length 9)?