Here is my code:
print('the whatever error occurred.')
How can I print the error/exception in my except: block?
For Python 2.6 and later and Python 3.x:
except Exception as e: print(e)
For Python 2.5 and earlier, use:
except Exception,e: print str(e)
Hope it helps!!
For Python 2.6 and later and Python ...READ MORE
Python doesn't have a native array data ...READ MORE
def firstAlphabet(self, s):
for i in range(len(s)):
if ...READ MORE
Hey @abhijmr.143, you can print array integers ...READ MORE
You can also use the random library's ...READ MORE
colors = ['red', 'green', ...READ MORE
can you give an example using a ...READ MORE
You can simply the built-in function in ...READ MORE
print(*names, sep = ', ')
This is what ...READ MORE
To import an updated package while in ...READ MORE
Already have an account? Sign in.