Create a deque with maxlen=4
A medium Python interview practice problem on DataDriven. Write and execute real python code with instant grading.
- Domain
- Python
- Difficulty
- medium
Problem
Create a deque with maxlen=4. Append the values 1 through 7 one at a time. Print the final contents as a list and the length.
Practice This Problem
Solve this Python problem with real code execution. DataDriven runs your Python code in a real environment and grades it automatically.