+ 1
Input Trouble
When I write len(input()) and then I put a matrix on it, it counts all the characters and not only the length of the matrix. What am I doing wrong? Thanks for your attention.
5 Answers
+ 3
Posting code will help you get a better answerđ
+ 1
how is the matrix formatted? code sample?
+ 1
The input should be something like [[5,7,8],[0,2,6],[0,0,8]]. And I wanted len(input()) == len([[5,7,8],[0,2,6],[0,0,8]]). It works when I write the matrix, but I wanted to add an input, so that people could try with any matrix in that form.
+ 1
store userinput as list instead of a string
0
Well, since it was reading [[], []] as "[[], []]" I made a function to create a matrix based on the string. Now it really works. Thank you all. I will made my code public, so if you want to see it just check my profile. It calculates the matrix determinant based on an input of the form above. Enjoy it! âșïž