Duplicate values

how does this code work to remove duplicate values


for i in s:
        print(i,end=" ")

I would say try to run it onto this: http://pythontutor.com/visualize.html#mode=edit

I’ve edited your post for readability. When you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read.

See this post to find the backtick on your keyboard. The “preformatted text” tool in the editor (</>) will also add backticks around text.

Note: Backticks are not single quotes.


I’m guessing that you didn’t write this code. How would you solve the problem to remove duplicates (there are many ways to skin this cat)? What parts of this code do you understand? Which parts confuse you?

No, i havent
i am a beginner in python
i want to understand how it works

Alright then just like ArieLeslie said what part is it that you do understand?
If the answer is completly nothing I would recomend you to do a course in python to learn the first basic steps.
Just like with biology you first will need to understand the basic’s before you can disect