assign the number of rows to a variable

asked 12 years ago

rd256 gravatar image

I am new to sage and have to write a function that reduced a matrix to row-echelon form. How do I assign the number of rows to the variable i inside a user-defined function?

Preview: (hide)

Comments

Your question is unclear. Are you asking about how to get the number of rows of a matrix? Use `M.nrows()` to get this. Are you asking about how to get this value and assign to a variable `i`? If you are asking this question, then use `i = M.nrows()` and read up about the Python programming language. EDIT: If this is homework, then please don't post homework questions here.

ppurka gravatar imageppurka ( 12 years ago )