Python Forum
Loop do not start for letter matching algoritm
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Loop do not start for letter matching algoritm
#3
Finaly I solved my problem by doing this :

t = 0
tab = [0] * 26

if len(j1) < len(j2):
    n = len(j1)
else:
    n = len(j2)

for i in range(n):

    if j1[i] == j2[i]:
        t += 1
        tab[i] = t
        
    if tab[i] == 0:
            break
Because in my programm I need to stop the loop on minimum lenght.

Thank you.
Reply


Messages In This Thread
RE: Loop do not start for letter matching algoritm - by phob0s - Jul-29-2019, 01:27 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Start loop from different points TheHolyPyGrenade 3 2,127 Apr-11-2021, 07:57 PM
Last Post: TheHolyPyGrenade
  What's the difference b/w assigning start=None and start=" " Madara 1 2,355 Aug-06-2018, 08:23 AM
Last Post: buran
  Can I Control loop with Keyboad key (start/stop) Lyperion 2 3,409 Jul-28-2018, 10:19 AM
Last Post: Lyperion
  Python- Help with try: input() except ValueError: Loop code to start of sequence Aldi 2 6,445 Mar-08-2018, 03:46 AM
Last Post: Larz60+

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020