What do you want to save?
Add Code snippet
New code examples
-
Python 2021-09-22 20:06:02
python try else pass
try: # Code to test / execute print('Test') except (SyntaxError, IndexError) as E: # specific exceptions # Code in case of SyntaxError for example print('Synthax or index error !') except : # Code for any other exception print('Other er... Add solution -
Python 2021-09-14 08:44:02
matrix multiplication python without numpy
The Numpythonic approach: (using numpy.dot in order to get the dot product of two matrices) In [1]: import numpy as np In [3]: np.dot([1,0,0,1,0,0], [[0,1],[1,1],[1,0],[1,0],[1,1],[0,1]]) Out[3]: array([1, 1]) The Pythonic approach: The length of your ... Add solution