def compute():
a = 5/0
try:
print(compute())
except ZeroDivisionError as ze:
print('Error: while dividing with zero it should through error')
Error: while dividing with zero it should through error
subjects=["Americans ","Indians "]
verbs=["play ","watch "]
objects=["Baseball","Cricket"]
for s in subjects:
for v in verbs:
for o in objects:
sentence = s+v+o
print(sentence)
Americans play Baseball
Americans play Cricket
Americans watch Baseball
Americans watch Cricket
Indians play Baseball
Indians play Cricket
Indians watch Baseball
Indians watch Cricket
import numpy as np
x = np.array([1, 2, 3, 4, 5, 6])
N = 3
np.vander(x, N)
np.column_stack([x**(N-1-i) for i in range(N)])
np.vander(x)
np.vander(x, increasing=True)
array([[ 1, 1, 1, 1, 1, 1],
[ 1, 2, 4, 8, 16, 32],
[ 1, 3, 9, 27, 81, 243],
[ 1, 4, 16, 64, 256, 1024],
[ 1, 5, 25, 125, 625, 3125],
[ 1, 6, 36, 216, 1296, 7776]])
import jovian
jovian.commit()
[jovian] Saving notebook..