How to detect duplicate letter in a string? python3 | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

How to detect duplicate letter in a string? python3

as the question, when we asking for input, and how do we detect if there is any duplicate character in python3

9th Nov 2017, 8:42 PM
DONG PEI
DONG PEI - avatar
6 Answers
9th Nov 2017, 9:03 PM
Kuba Siekierzyński
Kuba Siekierzyński - avatar
+ 6
When you say duplicate letter, what do you mean? In general? Consecutively? For example, "Tree" has duplicate letters that are consecutive. Whereas the word "consecutive" has duplicate letters but they're not consecutive.
9th Nov 2017, 8:46 PM
AgentSmith
+ 6
Sets automatically remove duplicates, and could reveal dups with respect to their final size. This may work If you don't need to identify which character is duplicated.
9th Nov 2017, 8:56 PM
Kirk Schafer
Kirk Schafer - avatar
+ 1
Hi, If we are asked to enter 26 letter in the alphabet in any order, how do we detect if there is duplicate character in the string. I have achieve anything else but detecting duplicate characters in the string. Appreciated
9th Nov 2017, 8:53 PM
DONG PEI
DONG PEI - avatar
9th Nov 2017, 9:04 PM
DONG PEI
DONG PEI - avatar
+ 1
This is my code so far, Appreciated
9th Nov 2017, 9:05 PM
DONG PEI
DONG PEI - avatar