2 * 3
6
a = 2
b = 3
c = a * b
print('the value of c is:', c)
the value of c is: 6
print(a, b)
2 3
d = a / b
print(f'print the value of a is {a}, and a / b equals: {d:.4e}')
print the value of a is 2, and a / b equals: 6.6667e-01
x = 3
y = (x - 1) * (x + 1)
print(y)
8
import numpy as np
np.cos(1)
0.5403023058681398
x = np.linspace(-4, 4, 100)
y = (x - 1) * (x + 1)
%matplotlib inline
import matplotlib.pyplot as plt
plt.plot(x, y, 'g', label='a green line')
plt.xlabel('this is the x-label')
plt.ylabel('y-label goes here')
plt.legend()
<matplotlib.legend.Legend at 0x1130698e0>