I understand the basics of this problem however I need help on how I can do this the most efficient way possible (taking the least amount of time for the programmer however not substituting stability of the code or efficiency).
Let's say we have a string:
grades=str(input("Enter a string"))
in my code, I would join a space between all characters in the string above and then split the characters into separate items in the same list:
grades=" ".join(grades)
grades.split(" ")
I then want to use loops of some sort to search the list for repeating items. However, I want to learn how I can do this the most efficient way possible:
x=len(grades)
for i in range(0, x):
if grades[i] == # here is were I'm having trouble
I want to know how I can search whether 1 item in the list is equal to any item in the whole list itself. Kind regards.