str2d.Str2D.roll_h
- Str2D.roll_h(x: int) Str2D [source]
Roll the data horizontally.
- Parameters:
x (int) – The number of positions to roll.
- Return type:
Examples
Let’s create an instance of Str2D and assign it to the variable a.
from str2d import Str2D a = Str2D('a b c d\ne f g\nh i\nj')
We can roll the data horizontally by passing the number of positions to roll.
a.roll_h(1)
da b c e f g h i j