Nov-21-2017, 10:14 AM
Hi all,
I am building a personal project to match items from two different db tables. I got stuck so I started to break down my problems in little pieces. Here is one little piece regarding the matching:
Your help is appreciated!
I am building a personal project to match items from two different db tables. I got stuck so I started to break down my problems in little pieces. Here is one little piece regarding the matching:
participants = ('bob','bill','casey') paid = ('bob', 'bill') n = 0 for name in participants: lookup = paid[n] if name == lookup: match =+ 1 n =+ 1 else: n =+1 if name == paid [n]: match =+ 1 print(match)
Output:1
I would expect to get 2 matches. I have used pythontutor to visually step through the code, and I don't understand why the second name would not result in a match. Below I included a link to pythontutor of the step where I don't understand that a match is made between "bill" and "bill" https://goo.gl/npDnYfYour help is appreciated!