ABCDEFGHIJKLMNOPQRSTUVWXYZAAABACADAEAFAGAHAIAJAKALAMANAOAPAQARASAT
1
The link content (in column E) that the participant provided... (check all that apply)The snippit (in column L) that the participant provided... (check all that apply)The participant's proposed fix (in column J)... (check all that apply)
2
ParticipantStimulus IDError PromptError MessageSO LinkNo link providedSO link explains a possible cause, directly provides a solution, or explains how to fix the error in error message (not program-specific)SO link explains a possible cause, directly provides a solution, or explains how to fix the error in error message (program-specific)SO link proposes an alternative approach to achieve the desired code functionalitySO link explains the cause, provides a solution, or is helpful for a different error in the program prompt than the one in the error messageGeneral Python Knowledge related to the programLink is not relevent to debugging the programSO Text/Code SnippetSource on pageSO snippit blank or not directly copied from SO linkSO snippet explains a possible cause, directly provides a solution, or explains how to fix the error in error message (not program-specific)SO snippet explains a possible cause, directly provides a solution, or explains how to fix the error in error message (program-specific)SO snippit proposes an alternative approach to achieve the desired code functionalitySO snippit explains the cause, provides a solution, or is helpful for a different program error than the one in the error messageSO snippit gives debugging adviceSO snippit shows example of correct code or structure relevent to the bugSpecific SO snippit not relevant for debugging the programProposed FixBlankCorrectly resolves the error indicated by the error message (without introducing new bugs)Does NOT resolve the error presented in the questionDoes not resolve error message, but on the right track / points out the causeResolves other errors that are not implicated in the error messageOn the right track for other errors that are not implicated in the error messageResolves error in question, but changes intended program functionality to do soResolves error in question, but would produce a new error (that did not already exist in the code) as a result of the proposed changeExtra stuff that is wrong
3
10https://drive.google.com/file/d/1GkSTw4zmeZVpm-3C5lkUy96q2OhA8aIx/view?usp=sharinghttps://drive.google.com/file/d/10rBxWdNkmnE9bmWps7ITaiZOB0C-A3s5/view?usp=sharingN/AN/AThere is missing colon at the end of the for statement
4
90https://drive.google.com/file/d/1GkSTw4zmeZVpm-3C5lkUy96q2OhA8aIx/view?usp=sharinghttps://drive.google.com/file/d/10rBxWdNkmnE9bmWps7ITaiZOB0C-A3s5/view?usp=sharing
5
130https://drive.google.com/file/d/1GkSTw4zmeZVpm-3C5lkUy96q2OhA8aIx/view?usp=sharinghttps://drive.google.com/file/d/10rBxWdNkmnE9bmWps7ITaiZOB0C-A3s5/view?usp=sharinghttps://stackoverflow.com/questions/42819041/range-function-syntax-errorfor i in range(5):questionfor w in range(9):
6
150https://drive.google.com/file/d/1GkSTw4zmeZVpm-3C5lkUy96q2OhA8aIx/view?usp=sharinghttps://drive.google.com/file/d/10rBxWdNkmnE9bmWps7ITaiZOB0C-A3s5/view?usp=sharinghttps://stackoverflow.com/questions/27705523/syntax-error-in-a-for-loop-in-pythonThe syntax is:

for j in range(row):
second answer
colon
7
190https://drive.google.com/file/d/1GkSTw4zmeZVpm-3C5lkUy96q2OhA8aIx/view?usp=sharinghttps://drive.google.com/file/d/10rBxWdNkmnE9bmWps7ITaiZOB0C-A3s5/view?usp=sharinghttps://stackoverflow.com/questions/27705523/syntax-error-in-a-for-loop-in-pythonThe syntax is:

for j in range(row):
second answer
add a colon after range(9)
8
220https://drive.google.com/file/d/1GkSTw4zmeZVpm-3C5lkUy96q2OhA8aIx/view?usp=sharinghttps://drive.google.com/file/d/10rBxWdNkmnE9bmWps7ITaiZOB0C-A3s5/view?usp=sharinghttps://stackoverflow.com/questions/27095402/syntax-error-in-for-loop
You have problems with indentation and colons. Specifically, each for statement needs a colon at the end, just before the following indented block of code.
top answerfor w in range(9):
9
240https://drive.google.com/file/d/1GkSTw4zmeZVpm-3C5lkUy96q2OhA8aIx/view?usp=sharinghttps://drive.google.com/file/d/10rBxWdNkmnE9bmWps7ITaiZOB0C-A3s5/view?usp=sharinghttps://stackoverflow.com/questions/4170656/for-loop-in-pythonI can do this

for k in range(1,c):
In Python, which would be identical to

for(int k = 1; k <= c ; k++)
questionThey forgot the : sign after the for loop
10
300https://drive.google.com/file/d/1GkSTw4zmeZVpm-3C5lkUy96q2OhA8aIx/view?usp=sharinghttps://drive.google.com/file/d/10rBxWdNkmnE9bmWps7ITaiZOB0C-A3s5/view?usp=sharingcould not findn/afor w in range(9):
11
310https://drive.google.com/file/d/1GkSTw4zmeZVpm-3C5lkUy96q2OhA8aIx/view?usp=sharinghttps://drive.google.com/file/d/10rBxWdNkmnE9bmWps7ITaiZOB0C-A3s5/view?usp=sharinghttps://stackoverflow.com/questions/39935281/safely-using-for-loop-variables-outside-the-loopI like to make it a habit of declaring all variables that will be used outside upfront (e.g., setting all variables to None or some other default at the beginning of a function), but it just comes down to preferencetop answer
12
350https://drive.google.com/file/d/1GkSTw4zmeZVpm-3C5lkUy96q2OhA8aIx/view?usp=sharinghttps://drive.google.com/file/d/10rBxWdNkmnE9bmWps7ITaiZOB0C-A3s5/view?usp=sharinghttps://stackoverflow.com/questions/47774358/python3-error-with-colon-in-if-statement/47774771is missing a ":"top/acceptedForgot colon after first line of for

...
for w in range(9):
...
13
360https://drive.google.com/file/d/1GkSTw4zmeZVpm-3C5lkUy96q2OhA8aIx/view?usp=sharinghttps://drive.google.com/file/d/10rBxWdNkmnE9bmWps7ITaiZOB0C-A3s5/view?usp=sharinghttps://stackoverflow.com/questions/85190/how-does-the-java-for-each-loop-workhe construct for each is also valid for arrays. e.g.

String[] fruits = new String[] { "Orange", "Apple", "Pear", "Strawberry" };

for (String fruit : fruits) {
// fruit is an element of the `fruits` array.
}
other answerThere should be ":" after range(9)
14
51https://drive.google.com/file/d/14cYoLA8_8Fh1I4-P-MMjfjKszCLPdoSH/view?usp=sharinghttps://drive.google.com/file/d/1ox4QFnAdeC49PUK--rfeKMDFiqhrm-j4/view?usp=sharinghttps://stackoverflow.com/questions/11621740/how-to-determine-whether-a-year-is-a-leap-yeardef leapyr(n):
if n%4==0 and n%100!=0:
if n%400==0:
question"def calculate_leapyear(years):
print(""year = "", years)
if (((years %4) == 0) && ((years %100) != 0)):
if (years %400) == 0):

print(""The year is a leap year."")

else:

print(""The year is not a leap year."")

return years
setup()"
15
101https://drive.google.com/file/d/14cYoLA8_8Fh1I4-P-MMjfjKszCLPdoSH/view?usp=sharinghttps://drive.google.com/file/d/1ox4QFnAdeC49PUK--rfeKMDFiqhrm-j4/view?usp=sharinghttps://stackoverflow.com/questions/11890095/invalid-syntax-error-in-python
https://stackoverflow.com/questions/34689390/python-def-function-invalid-syntax
https://stackoverflow.com/questions/37283081/python-function-defining-invalid-syntax
Most of these articles are discussing other syntax errors before the passed definition. Google at least is hiding any that forgot the colon on first pass through the results listing.

But, all of the results have correct function definitions with colons after them. Hopefully they'd notice theirs didn't. :-)
Just needs a colon:

line 4 -- def calculate_leapyear(years):
16
121https://drive.google.com/file/d/14cYoLA8_8Fh1I4-P-MMjfjKszCLPdoSH/view?usp=sharinghttps://drive.google.com/file/d/1ox4QFnAdeC49PUK--rfeKMDFiqhrm-j4/view?usp=sharinghttps://stackoverflow.com/a/60440375def is used to define a function. Normally the code should look like:

def getEntry(player, entries):
# Do stuff here
top answerdef calculate_leapyear(years):
17
141https://drive.google.com/file/d/14cYoLA8_8Fh1I4-P-MMjfjKszCLPdoSH/view?usp=sharinghttps://drive.google.com/file/d/1ox4QFnAdeC49PUK--rfeKMDFiqhrm-j4/view?usp=sharinghttps://stackoverflow.com/questions/18650313/python3-why-is-this-syntax-invalidYou need a colon after your function definition on line one:

def main():
top answerFunction definition should follow a new scope with colon.
def calculate_leapyear(years):
18
151https://drive.google.com/file/d/14cYoLA8_8Fh1I4-P-MMjfjKszCLPdoSH/view?usp=sharinghttps://drive.google.com/file/d/1ox4QFnAdeC49PUK--rfeKMDFiqhrm-j4/view?usp=sharinghttps://stackoverflow.com/questions/11890095/invalid-syntax-error-in-pythondef function(x): return x+2; function(2)top answercolon
19
201https://drive.google.com/file/d/14cYoLA8_8Fh1I4-P-MMjfjKszCLPdoSH/view?usp=sharinghttps://drive.google.com/file/d/1ox4QFnAdeC49PUK--rfeKMDFiqhrm-j4/view?usp=sharing# I didn't find a straight answer for it, but the following link helps
https://stackoverflow.com/questions/51072613/syntax-error-when-defining-a-function-on-the-python-command-line
# this code snippet reminds me about the colon
def hello():
print ("Hello!")

hello()
other answerdef calculate_leapyers(years):
.... Same as before ...
20
211https://drive.google.com/file/d/14cYoLA8_8Fh1I4-P-MMjfjKszCLPdoSH/view?usp=sharinghttps://drive.google.com/file/d/1ox4QFnAdeC49PUK--rfeKMDFiqhrm-j4/view?usp=sharinghttps://stackoverflow.com/questions/11890095/invalid-syntax-error-in-pythonYou need to separate the function definition from its execution. Also, Python is sensitive to whitespace at the beginning of lines. Try this (exactly):

def function(x):
return x+2
function(2)
top answerAdd a colon to the end of line 4.
21
271https://drive.google.com/file/d/14cYoLA8_8Fh1I4-P-MMjfjKszCLPdoSH/view?usp=sharinghttps://drive.google.com/file/d/1ox4QFnAdeC49PUK--rfeKMDFiqhrm-j4/view?usp=sharinghttps://stackoverflow.com/questions/12722767/how-to-correctly-define-a-functiondef count_letters(word):
return count_vowels(word) + count_consonants(word)
top/acceptedThe function declaration is missing a colon.
22
291https://drive.google.com/file/d/14cYoLA8_8Fh1I4-P-MMjfjKszCLPdoSH/view?usp=sharinghttps://drive.google.com/file/d/1ox4QFnAdeC49PUK--rfeKMDFiqhrm-j4/view?usp=sharingn/an/aline 4 is missing a ":", after noticing different 'def', they commonly use a ":" after naming the method.
23
321https://drive.google.com/file/d/14cYoLA8_8Fh1I4-P-MMjfjKszCLPdoSH/view?usp=sharinghttps://drive.google.com/file/d/1ox4QFnAdeC49PUK--rfeKMDFiqhrm-j4/view?usp=sharinghttps://stackoverflow.com/questions/24237111/syntax-error-invalid-syntax-for-no-apparent-reasonFor problems where it seems to be an error on a line you think is correct, you can often remove/comment the line where the error appears to be and, if the error moves to the next line, there are two possibilities.

Either both lines have a problem or the previous line has a problem which is being carried forward. The most likely case is the second option (even more so if you remove another line and it moves again).
top/acceptedAdd a colon at the end of line 4. Also indent lines 5-13 one to the left.
24
341https://drive.google.com/file/d/14cYoLA8_8Fh1I4-P-MMjfjKszCLPdoSH/view?usp=sharinghttps://drive.google.com/file/d/1ox4QFnAdeC49PUK--rfeKMDFiqhrm-j4/view?usp=sharinghttps://stackoverflow.com/questions/15235024/syntax-error-on-function-declaration-in-pythondef __init__(self):questiondef calculate_leapyear(years):
25
62https://drive.google.com/file/d/1-ZAhncs4A9w9cmGPJQyz_k4FbMwGK5OF/view?usp=sharinghttps://drive.google.com/file/d/1Qd62vF4tMhemAmksMZ4jP24nLj7Bhmp_/view?usp=sharinghttps://stackoverflow.com/questions/24237111/syntax-error-invalid-syntax-for-no-apparent-reasonFor problems where it seems to be an error on a line you think is correct, you can often remove/comment the line where the error appears to be and, if the error moves to the next line, there are two possibilities.

Either both lines have a problem or the previous line has a problem which is being carried forward. The most likely case is the second option (even more so if you remove another line and it moves again).
top/acceptedFix the first line - add " before "state". 2nd line needs a comma, or "".format()
26
72https://drive.google.com/file/d/1-ZAhncs4A9w9cmGPJQyz_k4FbMwGK5OF/view?usp=sharinghttps://drive.google.com/file/d/1Qd62vF4tMhemAmksMZ4jP24nLj7Bhmp_/view?usp=sharinghttps://stackoverflow.com/questions/18348717/how-to-use-concatenate-a-fixed-string-and-a-variable-in-pythonmsg['Subject'] = "Auto Hella Restart Report " + sys.argv[1]
# To concatenate strings in python, use ^
top/acceptedThere needs to be a "+" between "hello" and name

print("hello" + name)
27
122https://drive.google.com/file/d/1-ZAhncs4A9w9cmGPJQyz_k4FbMwGK5OF/view?usp=sharinghttps://drive.google.com/file/d/1Qd62vF4tMhemAmksMZ4jP24nLj7Bhmp_/view?usp=sharinghttps://stackoverflow.com/a/40296837name = input("What's your name? ")top/acceptedThis gives some examples at last showing that we need to have open and closed quotations.

name=input("state yuor name cuz")
28
132https://drive.google.com/file/d/1-ZAhncs4A9w9cmGPJQyz_k4FbMwGK5OF/view?usp=sharinghttps://drive.google.com/file/d/1Qd62vF4tMhemAmksMZ4jP24nLj7Bhmp_/view?usp=sharinghttps://stackoverflow.com/questions/2589309/command-line-input-causes-syntaxerrorinput("Please enter a phone number: ")questionEnsure quotes are properly used in the input block
29
182https://drive.google.com/file/d/1-ZAhncs4A9w9cmGPJQyz_k4FbMwGK5OF/view?usp=sharinghttps://drive.google.com/file/d/1Qd62vF4tMhemAmksMZ4jP24nLj7Bhmp_/view?usp=sharingI couldn't find anything on stack overflow that was directly linked to this issue. I feel like this issue was so simple that stack overflow couldn't be of much use. N/A name=input("state yuor name cuz")
30
232https://drive.google.com/file/d/1-ZAhncs4A9w9cmGPJQyz_k4FbMwGK5OF/view?usp=sharinghttps://drive.google.com/file/d/1Qd62vF4tMhemAmksMZ4jP24nLj7Bhmp_/view?usp=sharinghttps://stackoverflow.com/questions/58463606/how-do-you-format-user-input-as-an-f-string-in-pythonmessage = input('Enter your message: ')
question,top answer
There needs to be " before after the first (
ex: ("state...")
31
262https://drive.google.com/file/d/1-ZAhncs4A9w9cmGPJQyz_k4FbMwGK5OF/view?usp=sharinghttps://drive.google.com/file/d/1Qd62vF4tMhemAmksMZ4jP24nLj7Bhmp_/view?usp=sharinghttps://stackoverflow.com/questions/50437484/syntaxerror-on-input-supposedly-in-python-3input takes input from the user and then "executes" or "compiles" it so if you enter 4+9 in the input it will produce the number 13. Not the string "4+9"other answername=input("state yuor name cuz")
32
322https://drive.google.com/file/d/1-ZAhncs4A9w9cmGPJQyz_k4FbMwGK5OF/view?usp=sharinghttps://drive.google.com/file/d/1Qd62vF4tMhemAmksMZ4jP24nLj7Bhmp_/view?usp=sharinghttps://stackoverflow.com/questions/24237111/syntax-error-invalid-syntax-for-no-apparent-reason# open parentheses: 1 2 3
# v v v
fi2=0.460*scipy.sqrt(1-(Tr-0.566)**2/(0.434**2)+0.494
# ^ ^
# close parentheses: 1 2
top/acceptedname = input ("state your name cuz")
print("hello" + name)
33
372https://drive.google.com/file/d/1-ZAhncs4A9w9cmGPJQyz_k4FbMwGK5OF/view?usp=sharinghttps://drive.google.com/file/d/1Qd62vF4tMhemAmksMZ4jP24nLj7Bhmp_/view?usp=sharinghttps://stackoverflow.com/questions/19986096/invalid-syntax-error-when-using-print/19986114print("Hello how old are you?(years)") # <== missing this )
You're next syntax errors will probably be the following:

c=input() # <== missing ()

if int(c)==1: # <== missing :
print ("") # missing indentation
top answerAs the stack overflow response suggests, the invalid syntax comes from missing something that python expects to see when using the input() function. In this case, name=input(state yuor name cuz") is missing a " and should be corrected to name=input("state yuor name cuz")
34
382https://drive.google.com/file/d/1-ZAhncs4A9w9cmGPJQyz_k4FbMwGK5OF/view?usp=sharinghttps://drive.google.com/file/d/1Qd62vF4tMhemAmksMZ4jP24nLj7Bhmp_/view?usp=sharinghttps://stackoverflow.com/questions/53195935/invalid-syntax-error-when-linking-user-input-to-run-a-set-functionpythonCelsiusorFarenheit = input("Would you like Celsius to Farenheit or Farenheit
to Celcius?")

This link has an example of how input should be used
question,top answer
name=input("state yuor name cuz")
35
392https://drive.google.com/file/d/1-ZAhncs4A9w9cmGPJQyz_k4FbMwGK5OF/view?usp=sharinghttps://drive.google.com/file/d/1Qd62vF4tMhemAmksMZ4jP24nLj7Bhmp_/view?usp=sharinghttps://stackoverflow.com/questions/2589309/command-line-input-causes-syntaxerror(Second answer) The code snippet: input("Please enter a phone number: ")
other answername=input("state yuor name cuz")
36
23https://drive.google.com/file/d/1x0rpLb2XQWKMvPbB_X4Ff-p0jSKn4kGV/view?usp=sharinghttps://drive.google.com/file/d/1qbI4STen8i4Ku7VBUIpxHfb5nmd-E6pR/view?usp=sharing"https://stackoverflow.com/questions/5964927/syntaxerror-cant-assign-to-function-call
https://stackoverflow.com/questions/15719172/overload-operator-in-python
https://stackoverflow.com/questions/31087111/typeerror-list-object-is-not-callable-in-python"
Answers indicate that function call can't be on the left side of an assignment. That's how I "spotted" my syntax error.

But that got me wondering about whether lists can be callable.

---

You can make an object callable by implementing the __call__ method

---

From title: 'list' object is not callable in python
title,top/accepted
Line 3:

b[1] = 999
37
33https://drive.google.com/file/d/1x0rpLb2XQWKMvPbB_X4Ff-p0jSKn4kGV/view?usp=sharinghttps://drive.google.com/file/d/1qbI4STen8i4Ku7VBUIpxHfb5nmd-E6pR/view?usp=sharinghttps://stackoverflow.com/questions/29615710/syntaxerrorcant-assign-to-function-callThe top answer:



To write to a dict, use square brackets:

counts[email] = ...

instead of

counts(email) = ...

Round brackets () are used to call a function, so the interpreter thinks you are trying assign a value to a function call.
top/acceptedThe programmer has confused the array access syntax `[x]` with the function call syntax `(x)`. By using parentheses rather than square brackets, `b` is treated as if it were a `Callable`, rather than an indexable object, such as, in this case, a list.

Fix:
b[1] = 999
38
43https://drive.google.com/file/d/1x0rpLb2XQWKMvPbB_X4Ff-p0jSKn4kGV/view?usp=sharinghttps://drive.google.com/file/d/1qbI4STen8i4Ku7VBUIpxHfb5nmd-E6pR/view?usp=sharinghttps://stackoverflow.com/questions/42534823/syntaxerror-cant-assign-to-function-call/42534892stat['minimum'] not stat('minimum') – MooingRawr Mar 1 '17 at 14:50
I have resolved. It's stupid. Adding to a dictionary is: stat['minimum']=data.min() Not stat('minimum')=data.min() – phanindravarma Mar 1 '17 at 14:57
commentit needs to be b[1] not b(1)
39
163https://drive.google.com/file/d/1x0rpLb2XQWKMvPbB_X4Ff-p0jSKn4kGV/view?usp=sharinghttps://drive.google.com/file/d/1qbI4STen8i4Ku7VBUIpxHfb5nmd-E6pR/view?usp=sharinghttps://stackoverflow.com/questions/42534823/syntaxerror-cant-assign-to-function-call/42534892stat['minimum'] not stat('minimum')commentb(1) is an attempted function invocation, not indexing, which it seems like they were attempting to do here.

Additionally, tuples are not mutable, so that assignment after moving to b[1] will also fail. They'll need to move a = (1,2,3,4) to a = [1,2,3,4] for that to work.
40
173https://drive.google.com/file/d/1x0rpLb2XQWKMvPbB_X4Ff-p0jSKn4kGV/view?usp=sharinghttps://drive.google.com/file/d/1qbI4STen8i4Ku7VBUIpxHfb5nmd-E6pR/view?usp=sharinghttps://stackoverflow.com/questions/42534823/syntaxerror-cant-assign-to-function-call/42534892def statistics(data):
stat={}
stat['minimum']=data.min()
stat["maximum"]=data.max()
stat["mean"]=data.mean()
stat["median"]=data.median()
stat["std"]=data.std()
return stat

room_stat=statistics(data['RM'])
print room_stat
top/accepteda = (1, 2, 3, 4)
b = list(a)
b[1] = 999
print (b)
41
253https://drive.google.com/file/d/1x0rpLb2XQWKMvPbB_X4Ff-p0jSKn4kGV/view?usp=sharinghttps://drive.google.com/file/d/1qbI4STen8i4Ku7VBUIpxHfb5nmd-E6pR/view?usp=sharinghttps://stackoverflow.com/questions/10613131/how-to-access-list-elementsprint(cities[0][0], cities[1][0])top answera = [1, 2, 3, 4]
b = list(a)
b[1] = 999
print (b)
42
333https://drive.google.com/file/d/1x0rpLb2XQWKMvPbB_X4Ff-p0jSKn4kGV/view?usp=sharinghttps://drive.google.com/file/d/1qbI4STen8i4Ku7VBUIpxHfb5nmd-E6pR/view?usp=sharinghttps://stackoverflow.com/questions/5544228/assigning-a-value-to-python-list-doesnt-workchars[0] = 'd'top/acceptedb[1] = 999
43
353https://drive.google.com/file/d/1x0rpLb2XQWKMvPbB_X4Ff-p0jSKn4kGV/view?usp=sharinghttps://drive.google.com/file/d/1qbI4STen8i4Ku7VBUIpxHfb5nmd-E6pR/view?usp=sharinghttps://stackoverflow.com/questions/57179955/syntaxerror-cant-assign-to-function-call-in-pythonYou can't use int(something)= (that's a function call!), just do something=comment...
b[1] = 999
...
44
393https://drive.google.com/file/d/1x0rpLb2XQWKMvPbB_X4Ff-p0jSKn4kGV/view?usp=sharinghttps://drive.google.com/file/d/1qbI4STen8i4Ku7VBUIpxHfb5nmd-E6pR/view?usp=sharinghttps://stackoverflow.com/questions/1514553/how-to-declare-an-array-in-python# init with values (can contain mixed types)
arr = [1, "eels"]

# get item by index (can be negative to access end of array)
arr = [1, 2, 3, 4, 5, 6]
arr[0] # 1
arr[-1] # 6
other answerNot sure what this code is trying to accomplish, but I think the solution is to rewrite line 3 to be b[1] = 999;
45
403https://drive.google.com/file/d/1x0rpLb2XQWKMvPbB_X4Ff-p0jSKn4kGV/view?usp=sharinghttps://drive.google.com/file/d/1qbI4STen8i4Ku7VBUIpxHfb5nmd-E6pR/view?usp=sharinghttps://stackoverflow.com/questions/2582138/finding-and-replacing-elements-in-a-lista= [1, 2, 3, 4, 5, 1, 2, 3, 4, 5, 1]
>>> for n, i in enumerate(a):
... if i == 1:
... a[n] = 10
...
>>> a
[10, 2, 3, 4, 5, 10, 2, 3, 4, 5, 10]
top/acceptedb(1) = 999 should be changed to b[1] = 999
46
74https://drive.google.com/file/d/1Y-qXNY6JhpLFvwNSkC2DJSNsgPfswPgh/view?usp=sharinghttps://drive.google.com/file/d/1zdzIyXvl5qgK4j85XsXmiHhXIXBLx6xp/view?usp=sharinghttps://stackoverflow.com/questions/34376441/if-not-condition-statement-in-pythonif is the statement. not start is the expression, with not being a boolean operator.

not returns True if the operand (start here) is considered false. Python considers all objects to be true, unless they are numeric zero, or an empty container, or the None object or the boolean False value. not returns False if start is a true value. See the Truth Value Testing section in the documentation.
top/acceptedChange the ! symbol to the word "not".

if not i:
47
84https://drive.google.com/file/d/1Y-qXNY6JhpLFvwNSkC2DJSNsgPfswPgh/view?usp=sharinghttps://drive.google.com/file/d/1zdzIyXvl5qgK4j85XsXmiHhXIXBLx6xp/view?usp=sharinghttps://stackoverflow.com/questions/11387752/am-i-safe-mixing-types-in-a-python-listThe language is fine with you mixing types in a list, but you should know that the Python culture might frown on it.top/acceptedThe fix again depends on what the code is intended to do. I interpreted it as seeing if one of the elements in the list was false (or was equal to 1 which is equivalent). Since the list is all integers, it would be wise to simply add an "(if i == 1) break". If there are intended to be multiple types in the list, then a type check would be wise.
48
114https://drive.google.com/file/d/1Y-qXNY6JhpLFvwNSkC2DJSNsgPfswPgh/view?usp=sharinghttps://drive.google.com/file/d/1zdzIyXvl5qgK4j85XsXmiHhXIXBLx6xp/view?usp=sharing"a=[1,2,3,0,3]
for i in a:
if !=i:
break
print(i)"
49
144https://drive.google.com/file/d/1Y-qXNY6JhpLFvwNSkC2DJSNsgPfswPgh/view?usp=sharinghttps://drive.google.com/file/d/1zdzIyXvl5qgK4j85XsXmiHhXIXBLx6xp/view?usp=sharinghttps://stackoverflow.com/questions/2485466/pythons-equivalent-of-logical-and-in-an-if-statementSome of the operators you may know from other languages have a different name in Python. The logical operators && and || are actually called and and or. Likewise the logical negation operator ! is called not.other answerif not i:
50
164https://drive.google.com/file/d/1Y-qXNY6JhpLFvwNSkC2DJSNsgPfswPgh/view?usp=sharinghttps://drive.google.com/file/d/1zdzIyXvl5qgK4j85XsXmiHhXIXBLx6xp/view?usp=sharingn/an/a! is not the "not" operator in Python. Switch to "not"
51
214https://drive.google.com/file/d/1Y-qXNY6JhpLFvwNSkC2DJSNsgPfswPgh/view?usp=sharinghttps://drive.google.com/file/d/1zdzIyXvl5qgK4j85XsXmiHhXIXBLx6xp/view?usp=sharinghttps://stackoverflow.com/questions/22209729/what-does-do-mean-in-python!= means "not equal to" and is a logical comparison. Break down the logical expression here:

2 and 1 - 2 != 3
2 and -1 != 3
2 and True
True
top/acceptedOn line 3, add a "=" between "!" and "i".
52
244https://drive.google.com/file/d/1Y-qXNY6JhpLFvwNSkC2DJSNsgPfswPgh/view?usp=sharinghttps://drive.google.com/file/d/1zdzIyXvl5qgK4j85XsXmiHhXIXBLx6xp/view?usp=sharinghttps://stackoverflow.com/questions/11060506/is-there-a-not-equal-operator-in-python!=top/acceptedit needs to be !=, and it also needs to have somethin that it is not equal to
53
284https://drive.google.com/file/d/1Y-qXNY6JhpLFvwNSkC2DJSNsgPfswPgh/view?usp=sharinghttps://drive.google.com/file/d/1zdzIyXvl5qgK4j85XsXmiHhXIXBLx6xp/view?usp=sharinghttps://stackoverflow.com/questions/58049776/does-python-have-logical-inversion-mark-like-exclamation-mark-in-javaThere is no !-like prefix operator for booleans in Python, for this we use nottop answerChanging the ! to "not" could would, or changing "for i in a:" to "for i not in a:" might also work. I think that this would work:
a=[1,2,3,0,3]
if i not in a:
break
print(i)
54
304https://drive.google.com/file/d/1Y-qXNY6JhpLFvwNSkC2DJSNsgPfswPgh/view?usp=sharinghttps://drive.google.com/file/d/1zdzIyXvl5qgK4j85XsXmiHhXIXBLx6xp/view?usp=sharinghttps://stackoverflow.com/questions/6117733/negation-in-pythonThe negation operator in Python is not. Therefore just replace your ! with not.top/acceptedchange '!' to 'not'
55
314https://drive.google.com/file/d/1Y-qXNY6JhpLFvwNSkC2DJSNsgPfswPgh/view?usp=sharinghttps://drive.google.com/file/d/1zdzIyXvl5qgK4j85XsXmiHhXIXBLx6xp/view?usp=sharinghttps://stackoverflow.com/questions/16513573/if-var-false/50978588var = False
if not var:
print 'learnt stuff'
top/acceptedFirstly, i is not a boolean. Also, I think it said that you should use "not" instead of "!"
56
364https://drive.google.com/file/d/1Y-qXNY6JhpLFvwNSkC2DJSNsgPfswPgh/view?usp=sharinghttps://drive.google.com/file/d/1zdzIyXvl5qgK4j85XsXmiHhXIXBLx6xp/view?usp=sharinghttps://stackoverflow.com/questions/16749121/what-does-mean-in-pythont has now been removed in Python 3. Use != instead.top/acceptedused n != i (n number) instead for the if statement.
57
374https://drive.google.com/file/d/1Y-qXNY6JhpLFvwNSkC2DJSNsgPfswPgh/view?usp=sharinghttps://drive.google.com/file/d/1zdzIyXvl5qgK4j85XsXmiHhXIXBLx6xp/view?usp=sharingN/A, SyntaxError is too broad of an error messageThe given list a is a list of integers, and thus cannot be combined with the ! operator. A fix to this could be changing the items in a to booleans (True and False).
58
75https://drive.google.com/file/d/1hvf7h1hP2_-bIdbqbo9fM3nqJoJlLwzO/view?usp=sharinghttps://drive.google.com/file/d/18NgCqB48hWZqyXHNois62rpEE6L-loIw/view?usp=sharinghttps://stackoverflow.com/questions/1875676/python-2-6-str-format-and-regular-expressions^(w{{3}}\.)?([0-9A-Za-z-]+\.){{1}}{domainName}$'.format(domainName = 'delivery.com')
top/accepted,other answer
There needs to be a parentheses () around the width variable in order for Python to be able to recognize "width" to be a variable that should be replaced in format().
59
85https://drive.google.com/file/d/1hvf7h1hP2_-bIdbqbo9fM3nqJoJlLwzO/view?usp=sharinghttps://drive.google.com/file/d/18NgCqB48hWZqyXHNois62rpEE6L-loIw/view?usp=sharinghttps://stackoverflow.com/questions/5082452/string-formatting-vs-format-vs-string-literal
https://stackoverflow.com/questions/15286401/print-multiple-arguments-in-python/15286409
#!/usr/bin/python
sub1 = "python string!"
sub2 = "an arg"

sub_a = "i am a %s" % sub1
sub_b = "i am a {0}".format(sub1)
sub_c = f"i am a {sub1}"

arg_a = "with %(kwarg)s!" % {'kwarg':sub2}
arg_b = "with {kwarg}!".format(kwarg=sub2)
arg_c = f"with {sub2}!"

print(sub_a) # "i am a python string!"
print(sub_b) # "i am a python string!"
print(sub_c) # "i am a python string!"

print(arg_a) # "with an arg!"
print(arg_b) # "with an arg!"
print(arg_c) # "with an arg!"


print("Total score for {} is {}".format(name, score))
questionFor multiple arguments passed to a string, it looks like using something with multiple '{}' would work better. The arguments passed should not be predefined (but the casting is fine).
60
135https://drive.google.com/file/d/1hvf7h1hP2_-bIdbqbo9fM3nqJoJlLwzO/view?usp=sharinghttps://drive.google.com/file/d/18NgCqB48hWZqyXHNois62rpEE6L-loIw/view?usp=sharinghttps://stackoverflow.com/questions/2456148/getting-syntaxerror-for-print-with-keyword-argument-endprint "Building internam Index for %d tile(s) ..." % len(inputTiles),other answerwidth is not an argument of the print or of the format function, therefore I would just print width directly and in a separate statement from result[a]:

print('|{:^width}|'.format(str(width)))
61
155https://drive.google.com/file/d/1hvf7h1hP2_-bIdbqbo9fM3nqJoJlLwzO/view?usp=sharinghttps://drive.google.com/file/d/18NgCqB48hWZqyXHNois62rpEE6L-loIw/view?usp=sharinghttps://stackoverflow.com/questions/60968491/invalid-keyword-argument-for-printIn python, print is a function, which means you can't declare or assign values to variables within it. In some functions, you can specify parameters such as encoding="" in the open function where encoding is the keyword. There is no 'z' keyword for the print statement. The last time, it worked because you assigned the variable before the print statement and then printed it.

Try to do some basic research before you ask here, as this is not too complicated
other answerwidth=width
62
165https://drive.google.com/file/d/1hvf7h1hP2_-bIdbqbo9fM3nqJoJlLwzO/view?usp=sharinghttps://drive.google.com/file/d/18NgCqB48hWZqyXHNois62rpEE6L-loIw/view?usp=sharinghttps://stackoverflow.com/questions/17559242/var-is-an-invalid-keyword-argument-for-this-function-tkinter-and-pythonThe error is here:

v.set(str(var = var - dictionary[number]))

I think you're expecting the interpreter to calculate var - dictionary[number]; assign that value into var; and then pass the value of var along to the str() function as the first argument.

The first part of that does actually work - the interpreter does calculate var - dictionary[number]. However, instead of putting that value into var, it passes that value along to the str function as an argument named var. Because the string function isn't expecting an argument named var you get the error you've seen.
other answerwidth=width, the keyword argument, is in the wrong function. It's getting called in str() and needs to be called in the .format() function. Move it outside by one paren.
63
255https://drive.google.com/file/d/1hvf7h1hP2_-bIdbqbo9fM3nqJoJlLwzO/view?usp=sharinghttps://drive.google.com/file/d/18NgCqB48hWZqyXHNois62rpEE6L-loIw/view?usp=sharinghttps://stackoverflow.com/questions/10160390/pythons-format-function

https://stackoverflow.com/questions/7353486/why-str-cant-get-a-second-parameter-when-str-can
print a.format(data)
print a.format(year=year, month=month, location=location)
questionNot sure, but I don't think str() can have a second parameter and it might be solved by deleting one of the pare
64
265https://drive.google.com/file/d/1hvf7h1hP2_-bIdbqbo9fM3nqJoJlLwzO/view?usp=sharinghttps://drive.google.com/file/d/18NgCqB48hWZqyXHNois62rpEE6L-loIw/view?usp=sharinghttps://stackoverflow.com/questions/60968491/invalid-keyword-argument-for-print0

In python, print is a function, which means you can't declare or assign values to variables within it. In some functions, you can specify parameters such as encoding="" in the open function where encoding is the keyword. There is no 'z' keyword for the print statement.
other answer for a in range(height):
print('|{:^width}|'.format(str(result[a],
'width =' + width)))
65
305https://drive.google.com/file/d/1hvf7h1hP2_-bIdbqbo9fM3nqJoJlLwzO/view?usp=sharinghttps://drive.google.com/file/d/18NgCqB48hWZqyXHNois62rpEE6L-loIw/view?usp=sharinghttps://stackoverflow.com/questions/30109030/how-does-strlist-work/30109108The str() function in python is used to turn a value into a string.other answerstr(result[a])
66
355https://drive.google.com/file/d/1hvf7h1hP2_-bIdbqbo9fM3nqJoJlLwzO/view?usp=sharinghttps://drive.google.com/file/d/18NgCqB48hWZqyXHNois62rpEE6L-loIw/view?usp=sharinghttps://stackoverflow.com/questions/17559242/var-is-an-invalid-keyword-argument-for-this-function-tkinter-and-pythonstr function in python doesn't have var keyword argument.commentfor a in range(height):
print('|{:^width}|'.format(str(result[a]), str(width)))
67
395https://drive.google.com/file/d/1hvf7h1hP2_-bIdbqbo9fM3nqJoJlLwzO/view?usp=sharinghttps://drive.google.com/file/d/18NgCqB48hWZqyXHNois62rpEE6L-loIw/view?usp=sharinghttps://stackoverflow.com/questions/8450472/how-to-print-a-string-at-a-fixed-width(Second answer): width=10
'{0: <{width}}'.format('sss', width=width)
other answerprint('|{:^width}|'.format(str(result[a]), width = width))
68
405https://drive.google.com/file/d/1hvf7h1hP2_-bIdbqbo9fM3nqJoJlLwzO/view?usp=sharinghttps://drive.google.com/file/d/18NgCqB48hWZqyXHNois62rpEE6L-loIw/view?usp=sharing
69
16https://drive.google.com/file/d/1cDobcbJTUvKSycEu_rdiufDFJ3sN09ql/view?usp=sharinghttps://drive.google.com/file/d/1zer1P7MpLNHezpoSfxw0yZ-NPskkvI9E/view?usp=sharinghttps://stackoverflow.com/questions/32446402/typeerror-function-object-is-not-subscriptable-in-python-3-4-3"'function' object is not subscriptable means you're doing something like this:

def foo(): pass
something = foo[1]
What this means is that either Food_Prices or Food_Stock is actually a function rather than a variable. It should be easy to figure out which, by adding as simple print statement before the line that is causing the error."
top answerIn line 2, the string should be indexed, not the function itself
eg. string[0] == string[-1]
70
26https://drive.google.com/file/d/1cDobcbJTUvKSycEu_rdiufDFJ3sN09ql/view?usp=sharinghttps://drive.google.com/file/d/1zer1P7MpLNHezpoSfxw0yZ-NPskkvI9E/view?usp=sharinghttps://stackoverflow.com/questions/32446402/typeerror-function-object-is-not-subscriptable-in-python-3-4-3> What this means is that either Food_Prices or Food_Stock is actually a function rather than a variable.top answerLine 2:

if string[0] == string[-1]:
71
46https://drive.google.com/file/d/1cDobcbJTUvKSycEu_rdiufDFJ3sN09ql/view?usp=sharinghttps://drive.google.com/file/d/1zer1P7MpLNHezpoSfxw0yZ-NPskkvI9E/view?usp=sharinghttps://stackoverflow.com/questions/32446402/typeerror-function-object-is-not-subscriptable-in-python-3-4-3function' object is not subscriptable means you're doing something like this:

def foo(): pass
something = foo[1]
What this means is that either Food_Prices or Food_Stock is actually a function rather than a variable
top answerI think in the if statement you want to index into string that is passed in not into the function.
72
66https://drive.google.com/file/d/1cDobcbJTUvKSycEu_rdiufDFJ3sN09ql/view?usp=sharinghttps://drive.google.com/file/d/1zer1P7MpLNHezpoSfxw0yZ-NPskkvI9E/view?usp=sharinghttps://stackoverflow.com/questions/32446402/typeerror-function-object-is-not-subscriptable-in-python-3-4-3What this means is that either Food_Prices or Food_Stock is actually a function rather than a variable. It should be easy to figure out which, by adding as simple print statement before the line that is causing the error.top answerif string[0] == string[-1]:
73
156https://drive.google.com/file/d/1cDobcbJTUvKSycEu_rdiufDFJ3sN09ql/view?usp=sharinghttps://drive.google.com/file/d/1zer1P7MpLNHezpoSfxw0yZ-NPskkvI9E/view?usp=sharinghttps://stackoverflow.com/questions/29101836/typeerror-function-object-is-not-subscriptable-pythonYou have two objects both named bank_holiday -- one a list and one a function. Disambiguate the two.top answerstring[0] == string[-1]
74
176https://drive.google.com/file/d/1cDobcbJTUvKSycEu_rdiufDFJ3sN09ql/view?usp=sharinghttps://drive.google.com/file/d/1zer1P7MpLNHezpoSfxw0yZ-NPskkvI9E/view?usp=sharinghttps://stackoverflow.com/questions/33380936/typeerror-function-object-is-not-subscriptableYou want to apply [1:] to l, not to sumList (sumList is a function).top/accepteddef pd(string):
if string[0]== string[-1]:
return True
else:
return False
pd(string[1:-1])

pd('1221')
75
206https://drive.google.com/file/d/1cDobcbJTUvKSycEu_rdiufDFJ3sN09ql/view?usp=sharinghttps://drive.google.com/file/d/1zer1P7MpLNHezpoSfxw0yZ-NPskkvI9E/view?usp=sharinghttps://stackoverflow.com/questions/32446402/typeerror-function-object-is-not-subscriptable-in-python-3-4-3function' object is not subscriptable means you're doing something like this:

def foo(): pass
something = foo[1]
top answerif string[0] == string[-1]:
... Same as before ...
76
246https://drive.google.com/file/d/1cDobcbJTUvKSycEu_rdiufDFJ3sN09ql/view?usp=sharinghttps://drive.google.com/file/d/1zer1P7MpLNHezpoSfxw0yZ-NPskkvI9E/view?usp=sharingDidn't find it on a sitepd('1221') needs to be earlier, since it tries indexing into something that is undefined, which causes an error.
77
306https://drive.google.com/file/d/1cDobcbJTUvKSycEu_rdiufDFJ3sN09ql/view?usp=sharinghttps://drive.google.com/file/d/1zer1P7MpLNHezpoSfxw0yZ-NPskkvI9E/view?usp=sharinghttps://stackoverflow.com/questions/29101836/typeerror-function-object-is-not-subscriptable-pythonYou have two objects both named bank_holiday -- one a list and one a function. Disambiguate the two.

bank_holiday[month] is raising an error because Python thinks bank_holiday refers to the function (the last object bound to the name bank_holiday), whereas you probably intend it to mean the list.
top answerif string[0] == string[-1]
78
316https://drive.google.com/file/d/1cDobcbJTUvKSycEu_rdiufDFJ3sN09ql/view?usp=sharinghttps://drive.google.com/file/d/1zer1P7MpLNHezpoSfxw0yZ-NPskkvI9E/view?usp=sharinghttps://stackoverflow.com/questions/29101836/typeerror-function-object-is-not-subscriptable-pythonfunction' object is not subscriptable means you're doing something like this:

def foo(): pass
something = foo[1]

Most likely this is because you have a function somewhere else in your code named either Food_Prices or Food_Stock, or you've reassigned the value of one of those variables.
top answerThey accidentally indexed the function instead of the string that the function takes in
79
366https://drive.google.com/file/d/1cDobcbJTUvKSycEu_rdiufDFJ3sN09ql/view?usp=sharinghttps://drive.google.com/file/d/1zer1P7MpLNHezpoSfxw0yZ-NPskkvI9E/view?usp=sharinghttps://stackoverflow.com/questions/29101836/typeerror-function-object-is-not-subscriptable-pythonbank_holiday[month] is raising an error because Python thinks bank_holiday refers to the function (the last object bound to the name bank_holiday), whereas you probably intend it to mean the list.top answerThere is a function inside it's own fucntion. Disambiguate pd(string[1:-1]).
80
37https://drive.google.com/file/d/19UZCAcsKPrwfg0cBDwiW2hRd6Ysj-gYR/view?usp=sharinghttps://drive.google.com/file/d/1txtBDPtRABM0QM3bUvyKb18hJIgXz7Lv/view?usp=sharinghttps://stackoverflow.com/questions/5796238/python-convert-decimal-to-hexI think this solution is elegant:

def toHex(dec):
x = (dec % 16)
digits = "0123456789ABCDEF"
rest = dec / 16
if (rest == 0):
return digits[x]
return toHex(rest) + digits[x]

numbers = [0, 11, 16, 32, 33, 41, 45, 678, 574893]
print [toHex(x) for x in numbers]
print [hex(x) for x in numbers]

This output:

['0', 'B', '10', '20', '21', '29', '2D', '2A6', '8C5AD']
['0x0', '0xb', '0x10', '0x20', '0x21', '0x29', '0x2d', '0x2a6', '0x8c5ad']
other answerThere's a few issues here.

The immediate failure is that `idx` is a string and so it's not indexable. It looks like the programmer meant to do `table[idx]`.

For one, the loop variable `idx` in the loop on line 21 is looping over the individual characters, represented as strings, in the input number, `number`. This doesn't really make sense, since the conversion needs to be from base 10 to base 16 -- you can't just lookup each of the digits in a base-10 number to convert it into base 16. Instead, you could the standard library to do this, or, if you want to implement it from scratch you can successively repeat integer divisions / modulo operations.
81
97https://drive.google.com/file/d/19UZCAcsKPrwfg0cBDwiW2hRd6Ysj-gYR/view?usp=sharinghttps://drive.google.com/file/d/1txtBDPtRABM0QM3bUvyKb18hJIgXz7Lv/view?usp=sharinghttps://stackoverflow.com/questions/27312553/python-typeerror-string-indices-must-be-integers-how-to-fixEither activity or activity['object'] is a string and not a dictionary as you expect. Print data and check.top answerSwap idx and table: decToHexConvert += table[idx]
82
137https://drive.google.com/file/d/19UZCAcsKPrwfg0cBDwiW2hRd6Ysj-gYR/view?usp=sharinghttps://drive.google.com/file/d/1txtBDPtRABM0QM3bUvyKb18hJIgXz7Lv/view?usp=sharinghttps://stackoverflow.com/questions/6077675/why-am-i-seeing-typeerror-string-indices-must-be-integersdata is a dict object. So, iterate over it like this:

Python 2
for key, value in data.iteritems():
print key, value
Python 3
for key, value in data.items():
print(key, value)
other answerdecToHexConvert += table[idx]
83
167https://drive.google.com/file/d/19UZCAcsKPrwfg0cBDwiW2hRd6Ysj-gYR/view?usp=sharinghttps://drive.google.com/file/d/1txtBDPtRABM0QM3bUvyKb18hJIgXz7Lv/view?usp=sharinghttps://stackoverflow.com/questions/40785555/basic-python-misunderstanding-of-dict-typeerror-string-indices-must-be-integerIn your code trying to index string with string instead of dictionary.top answertable and idx are flipped here. I assume they were intending to get the value in the table dictionary with the "index" idx variable.
84
197https://drive.google.com/file/d/19UZCAcsKPrwfg0cBDwiW2hRd6Ysj-gYR/view?usp=sharinghttps://drive.google.com/file/d/1txtBDPtRABM0QM3bUvyKb18hJIgXz7Lv/view?usp=sharinghttps://stackoverflow.com/questions/6077675/why-am-i-seeing-typeerror-string-indices-must-be-integersStrings can't have string indices (like dictionaries can). So this won't work:

>>> mystring = 'helloworld'
>>> print mystring['stringindex']
TypeError: string indices must be integers
other answerdecToHexConvert += table[idx] instead of idx[table]
85
227https://drive.google.com/file/d/19UZCAcsKPrwfg0cBDwiW2hRd6Ysj-gYR/view?usp=sharinghttps://drive.google.com/file/d/1txtBDPtRABM0QM3bUvyKb18hJIgXz7Lv/view?usp=sharinghttps://stackoverflow.com/questions/6077675/why-am-i-seeing-typeerror-string-indices-must-be-integersWe need to replace the comma , with a colon :other answerdecToHex(15)
86
247https://drive.google.com/file/d/19UZCAcsKPrwfg0cBDwiW2hRd6Ysj-gYR/view?usp=sharinghttps://drive.google.com/file/d/1txtBDPtRABM0QM3bUvyKb18hJIgXz7Lv/view?usp=sharinghttps://stackoverflow.com/questions/33948354/how-to-get-indexes-of-elements-in-a-table-using-pythonT[i]top/acceptedit should be table[id], not idx[table]
87
277https://drive.google.com/file/d/19UZCAcsKPrwfg0cBDwiW2hRd6Ysj-gYR/view?usp=sharinghttps://drive.google.com/file/d/1txtBDPtRABM0QM3bUvyKb18hJIgXz7Lv/view?usp=sharinghttps://stackoverflow.com/questions/49695836/typeerror-string-indices-must-be-integers-pythondata['result'] is a dictionary. Iterating over dict means iterating over its keys. Therefore key variable stores a string. That's why key['id'] raises TypeError: string indices must be integers.top/acceptedThe dec to hex converter needs to take the whole '15' string not by index because 1 and 5 will be converted separately.
88
317https://drive.google.com/file/d/19UZCAcsKPrwfg0cBDwiW2hRd6Ysj-gYR/view?usp=sharinghttps://drive.google.com/file/d/1txtBDPtRABM0QM3bUvyKb18hJIgXz7Lv/view?usp=sharinghttps://stackoverflow.com/questions/6077675/why-am-i-seeing-typeerror-string-indices-must-be-integers>>> mystring = 'helloworld'
>>> print mystring[0]
'h'
other answerUh I think there's probably quite a few errors with the code in the sense of getting what the function should get, but in terms of just coding errors, you can't call "idx[table]" because in our case, table is an entire dictionary. For string indices, you need to use numbers (ex: str[0]).
89
337https://drive.google.com/file/d/19UZCAcsKPrwfg0cBDwiW2hRd6Ysj-gYR/view?usp=sharinghttps://drive.google.com/file/d/1txtBDPtRABM0QM3bUvyKb18hJIgXz7Lv/view?usp=sharinghttps://stackoverflow.com/questions/49695836/typeerror-string-indices-must-be-integers-pythonIterating over dict means iterating over its keys. Therefore key variable stores a string.top/accepteddecToHexConvert += table[idx] on line 22
90
347https://drive.google.com/file/d/19UZCAcsKPrwfg0cBDwiW2hRd6Ysj-gYR/view?usp=sharinghttps://drive.google.com/file/d/1txtBDPtRABM0QM3bUvyKb18hJIgXz7Lv/view?usp=sharinghttps://stackoverflow.com/questions/6077675/why-am-i-seeing-typeerror-string-indices-must-be-integersdecToHexConvert += table[idx]
91
357https://drive.google.com/file/d/19UZCAcsKPrwfg0cBDwiW2hRd6Ysj-gYR/view?usp=sharinghttps://drive.google.com/file/d/1txtBDPtRABM0QM3bUvyKb18hJIgXz7Lv/view?usp=sharinghttps://stackoverflow.com/questions/6077675/why-am-i-seeing-typeerror-string-indices-must-be-integersitem is most likely a string in your code; the string indices are the ones in the square brackets, e.g., gravatar_id. So I'd first check your data variable to see what you received there; I guess that data is a list of strings (or at least a list containing at least one string) while it should be a list of dictionaries.
accepted answer
The index can't be a string, so you need to convert the '15' to an integer first then iterate over the dictionary
92
387https://drive.google.com/file/d/19UZCAcsKPrwfg0cBDwiW2hRd6Ysj-gYR/view?usp=sharinghttps://drive.google.com/file/d/1txtBDPtRABM0QM3bUvyKb18hJIgXz7Lv/view?usp=sharinghttps://stackoverflow.com/questions/41836011/typeerror-string-indices-must-be-integers-error-when-parsing-json-with-pythonfor each in data['items']:
print(each['created_on'])
questiondecToHexConvert += table[idx]
93
78https://drive.google.com/file/d/1McYm9CgMgHWC_vsyVn4VBh1tLaGH-vnT/view?usp=sharinghttps://drive.google.com/file/d/1DHzCmI8yeVCX_YvU-3EZoTzClfsSvLvI/view?usp=sharinghttps://stackoverflow.com/questions/60504217/typeerror-not-supported-between-instances-of-list-and-intError at line while complete < 30. The complete is a list and you try to compare it with a integer number 30? If you want to compare the list length, use while len(complete) < 30.top answerThe problem here is that the programmer is trying to compare a list to an integer. I believe the programmer meant to initialize smallest to xs[0], rather than the entire xs list. The variable smaller should be initialized to xs[0] as well.
94
108https://drive.google.com/file/d/1McYm9CgMgHWC_vsyVn4VBh1tLaGH-vnT/view?usp=sharinghttps://drive.google.com/file/d/1DHzCmI8yeVCX_YvU-3EZoTzClfsSvLvI/view?usp=sharinghttps://stackoverflow.com/questions/58403569/python-typeerror-not-supported-between-instances-of-int-and-list"I really think this should be a built-in operation for comparison operators. e.g. 3 < [4,5] should return [True, True] and 3 < [3,4] should return [False, True]" -- OP

"@DanGoodrick I disagree. Python is a general purpose programming language that is strongly typed. Comparison operations between distinct types should be an error." -- bystander
commentdef second_smallest(xs):
smallest=xs[0] # Here -- previously was assigning an entire list rather than a single index
smaller=xs[0] # here -- As above
for i in range(len(xs)): # Here, we were creating a new list containing a single element, the value of smaller (which was also itself a list previously). i would at most be 0.
if smallest>xs[i]:
smaller=smallest
smallest=xs[i] # Previously smallest was assigned the current index, not the value at the current index.
elif smaller>xs[i] and not smallest==1: #???
smaller=xs[i] #
return smaller
second_smallest([1,2,3,4])
95
128https://drive.google.com/file/d/1McYm9CgMgHWC_vsyVn4VBh1tLaGH-vnT/view?usp=sharinghttps://drive.google.com/file/d/1DHzCmI8yeVCX_YvU-3EZoTzClfsSvLvI/view?usp=sharinghttps://stackoverflow.com/questions/55946241/typeerror-not-supported-between-instances-of-list-and-int-pythonHint: try to understand the error message. Which of those is a list and which is an int? Do you want them to be list or int? Why is the type not as you expect?commentsmallest=xs[0]

smaller=xs[0]

(technically this does not work if the list is empty)
96
178https://drive.google.com/file/d/1McYm9CgMgHWC_vsyVn4VBh1tLaGH-vnT/view?usp=sharinghttps://drive.google.com/file/d/1DHzCmI8yeVCX_YvU-3EZoTzClfsSvLvI/view?usp=sharinghttps://stackoverflow.com/questions/49472108/typeerror-not-supported-between-instances-of-list-and-int/49472188This is the root of all your problems, since now suffix[0] becomes a list after the first iteration through your loop. The biggest change you needed was as follows:top/accepteddef second_smallest(xs):
smallest=xs[0]
smaller=XS[0]
for i in range(len([smaller])):
if smallest>i:
smaller=smallest
smallest=i
elif smaller>i and not smallest==1:
smaller=i
return smaller
second_smallest([1,2,3,4])
97
198https://drive.google.com/file/d/1McYm9CgMgHWC_vsyVn4VBh1tLaGH-vnT/view?usp=sharinghttps://drive.google.com/file/d/1DHzCmI8yeVCX_YvU-3EZoTzClfsSvLvI/view?usp=sharinghttps://stackoverflow.com/questions/49472108/typeerror-not-supported-between-instances-of-list-and-int/49472188You have a lot of issues where you don't distinguish between lists and integers.

million = [1000000, "M"]
billion = [million * 1000, "B"]
billion[0] is not actually a 1000000 * 1000, its a length 1000 list.

This is the root of all your problems, since now suffix[0] becomes a list after the first iteration through your loop. The biggest change you needed was as follows:

million = [1000000, "M"]
billion = [million[0] * 1000, "B"]
trillion = [billion[0] * 1000, "T"]
quadrillion = [trillion[0] * 1000, "Qd"]
quintillion = [quadrillion[0] * 1000, "Qn"]
sx = [quintillion[0] * 1000, "Sx"]
septillion = [sx[0] * 1000, "Sp"]
top/accepteduse something like this instead of the first two lines in the function:
smaller = max(xs[0], xs[1])
smallest = min(xs[0], xs[1])
98
238https://drive.google.com/file/d/1McYm9CgMgHWC_vsyVn4VBh1tLaGH-vnT/view?usp=sharinghttps://drive.google.com/file/d/1DHzCmI8yeVCX_YvU-3EZoTzClfsSvLvI/view?usp=sharinghttps://stackoverflow.com/questions/60504217/typeerror-not-supported-between-instances-of-list-and-intError at line while complete < 30. The complete is a list and you try to compare it with a integer number 30? If you want to compare the list length, use while len(complete) < 30top answerfor i in range(len([smaller])) should be rewritten as: for i in len(smaller)
99
258https://drive.google.com/file/d/1McYm9CgMgHWC_vsyVn4VBh1tLaGH-vnT/view?usp=sharinghttps://drive.google.com/file/d/1DHzCmI8yeVCX_YvU-3EZoTzClfsSvLvI/view?usp=sharinghttps://stackoverflow.com/questions/60504217/typeerror-not-supported-between-instances-of-list-and-intError at line while complete < 30. The complete is a list and you try to compare it with a integer number 30?top answerYou have to access the element of the list being inputted. You can do something like
if smallest[i] > i:, and the same for the rest of them, rather than just putting smallest
100
268https://drive.google.com/file/d/1McYm9CgMgHWC_vsyVn4VBh1tLaGH-vnT/view?usp=sharinghttps://drive.google.com/file/d/1DHzCmI8yeVCX_YvU-3EZoTzClfsSvLvI/view?usp=sharinghttps://stackoverflow.com/questions/60504217/typeerror-not-supported-between-instances-of-list-and-int2

Error at line while complete < 30. The complete is a list and you try to compare it with a integer number 30? If you want to compare the list length, use while len(complete) < 30.
top answersmallest is set to the list xs so you cannot compare it to i which is an int. Most likely the code wants to compare the i'th element of smallest so
if smallest[i] > i
Similarly with the elif statement to avoid another error.