I’m am new to python and have for the last couple of days been trying to get the following code to print it is supposed to multiply two matrices but it just gives me a black screen or prints a 0
Here is the code
Please don’t post screenshots.
Copy and paste any code or traceback, and in order to preserve formatting, select the code or traceback that you posted and then click the </>
button.
Nowhere in that code are you calling multiply_matrices
. You’re just assigning to some variables, including finalMatrix
, and then printing finalMatrix
.
If you’re calling it and it’s returning 0
, it’s probably because of one of the return finalValue
lines.
Hello,
you can do matrix multiplication with Numpy
. Much easier and less verbose.
Hope this helps.
Please do not include screenshots. Screenshots prevent us from running the code and helping you. Make sure to paste the code in code fences for Markdown.
Markdown tutorials
- Introduction to markdown. Introduction to Markdown — Write the Docs
- Markdown Cheat Sheet. Markdown Cheat Sheet | Markdown Guide
- Markdown tutorial. https://www.markdowntutorial.com/
- W3 Schools. Learn Markdown: A Beginner's Guide to Basic and Extended Syntax
The first time you return finalValue
, you forget to capitalize the V in value.