0
Few issues with this code.
https://code.sololearn.com/cIE353eB2OAU/?ref=app Here the code works just fine for what it is made for but when I input a text with more then 1 recurring characters it prints both of them.. tried fixing it up with break statement but it messes up the program like Using break: Input abba Output a Output should be b in this case.
3 Answers
+ 1
Well one idea, you could keep a list of the recurring letters in order of which they first repeat and if you just want the first, then you can print the first element in that list.
recurring = []
for i in text:
for j in list_in:
if i == j:
recurring.append(i)
list_in.append(i)
print(recurring[0])
0
Jake yeh that would be a great idea but maybe I'm looking for something to fox that without adding few new things
0
Fix*