Fundamentals
Strings
from collections import deque def test(): dequedStr = deque("test") return ''.join([dequedStr.popleft() for x in range(len(dequedStr))])
from itertools import compress- from collections import deque
- def test():
string = "letters inside a string"digits = [0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0]result = compress(string, digits)return ''.join(list(result))- dequedStr = deque("test")
- return ''.join([dequedStr.popleft() for x in range(len(dequedStr))])
Fundamentals
Strings