• matplotlib - numpy

    How to Plot cos(x) in Python Using Matplotlib and NumPy (Cosine Function Graph Tutorial)

    This tutorial demonstrates how to plot the cosine function cos(x) in Python using Matplotlib and NumPy, creating a clean cosine wave graph for beginners. Matplotlib is a Python plotting library whose pyplot module makes it easy to create a cos(x) plot in Python, giving you MATLAB‑style plotting capabilities with simple code. NumPy is essential for numerical operations in Python, and here we utilize it to generate the array of x-values and calculate the cosine values efficiently. This combination is creating a wide variety of scientific and data visualizations in Python.

  • turtle

    Draw random stars using turtle

    Enjoy creating random objects with Python. Now, let’s have some fun drawing stars in various positions and colors. Turtle graphics is a simple and fun way to create drawings with Python code. It uses a virtual turtle that you can command to move around the screen and draw lines, shapes, and more. This makes it an excellent tool for learning basic programming concepts and exploring visual outputs with code. We will use Turtle to draw randomly generated stars, demonstrating how to control the turtle’s movement, color, and shape properties programmatically.