Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- s = "We tried list and we tried dicts also we tried Zen"
- dic = {}
- a = int(0)
- dic_length = int(0)
- x = int(0)
- y = int(0)
- z = int(0)
- for word in s.split(" "):
- dic[a] = word
- a += 1
- for value in dic.items():
- dic_length += 1
- print(dic)
- print(dic_length)
- while x < dic_length:
- while y < dic_length: # while not at end of dic
- if dic.get(x) == dic.get(y):
- print("loop 2 ", x, y, z)
- print(dic.get(x))
- print(dic.get(y))
- z += 1
- y += 1
- dic2 = dic.get(y)
- x += 1
- print("loop 1 ", x, y, z)
Advertisement
Add Comment
Please, Sign In to add comment