[text] Рро

Viewer

  1. import numpy as np
  2. import matplotlib.pyplot as plt
  3.  
  4. # Задаємо діапазон значень x
  5. x = np.linspace(-5, 5, 400)  # Від -5 до 5 з 400 точками
  6.  
  7. # Рахуємо значення функції для кожного x
  8. y = 2**x
  9.  
  10. # Будуємо графік
  11. plt.plot(x, y, label='f(x) = 2^x')
  12. plt.xlabel('x')
  13. plt.ylabel('f(x)')
  14. plt.title('Графік функції f(x) = 2^x')
  15. plt.grid(True)
  16. plt.legend()
  17. plt.show()
  18.  

Editor

You can edit this paste and save as new:


File Description
  • Рро
  • Paste Code
  • 04 Oct-2023
  • 465 Bytes
You can Share it: