assign the number of rows to a variable
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?
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.