What do the brackets do in this function?

def common_letters(string_one, string_two):
common =
for letter in string_one:
if (letter in string_two) and not (letter in common):
common.append(letter)
return common
print (common_letters(“banana”, “cream”))

(also, which html thing do you use to indent?)

Brackets are for lists. You have a variable set to an empty list.

Use the “</>” to format code

See:

Also:

1 Like