Rolling Function In Python Practice