Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #PROBLEM 1
- def pair(l1):
- list1 = l1
- ctr = 0
- result = []
- while ctr < len(list1):
- result.append(str(list1[ctr]))
- if ctr+2<len(list1):
- result[ctr/4] += "," + str(list1[ctr+2])
- ctr += 4
- return result
- #PROBLEM 2
- def replace(l1,l2):
- string1 = l1
- char = l2
- ctr = 0
- while ctr < len(string1):
- if string1[ctr] == l2:
- string1[ctr] == "q"
- return string1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement