All Questions
Tagged with substrings similarities
6 questions
0
votes
1
answer
109
views
PSET 7 similarities substrings function seems ok but dont pass test
I make a substrings function, it seems to work for me, but i cant pass check.
:( handles one substring in common
Expected 1 matches, not 0
:( handles multiple substrings in common
Expected 4 ...
0
votes
1
answer
145
views
Where am I going wrong in Similarities: Substrings?
I am currently working on PSet7: Similarities. I have completed all the tests so far except substrings and I was wondering if any of you could tell me where I am going wrong. I am currently failing ...
1
vote
2
answers
292
views
Pset6 similarities less substrings I get wrong output
I’m super close. But I cannot figure out right formula. It doesn’t count amount of the similar substrings correctly. I mean the output is wrong.
https://pastebin.com/gEvxAS1X
1
vote
1
answer
380
views
PSET6 Similarities substrings almost done
def substrings(a, b, n):
"""Return substrings of length n in both a and b"""
global seta
global setb
x = []
y = []
for i in range(len(a) - n + 1):
x.append(a[i:i+n])
...
1
vote
1
answer
236
views
PSET6 Similarities HELP!
I am almost done with similarities I think. Can't really figure out what is wrong with my substrings
def substrings(a, b, n):
"""Return substrings of length n in both a and b"""
x = []
y =...
0
votes
1
answer
551
views
pset6 similarities substrings fails check50 in 3 cases, but not sure what's wrong with logic
My code isn't efficient, but it's not convoluted which is rare for me. I wrote a helper function, 'slicer', which iterates over the length of a and slices a into length n substrings. 'Substrings' ...