Yandex

Python Built-in FunctionsPython Built-in Functions0

    Python String MethodsPython String Methods0

      Python Variables



      Visualization

      Imagine you have a box where you can store anything you want — a number, a word, or even a whole sentence. In Python, we use something called a variable to store information like that!

      What is a Variable?

      A variable is like a label you stick on a box to remember what’s inside.

      For example, you can create a variable called name and store your name in it:

      name = "Alice"

      Here, name is the variable, and "Alice" is the information we are saving inside it.

      Another Example

      Let's save a number in a variable:

      age = 25

      Now, the variable age holds the number 25.

      How to Use Variables

      After you create a variable, you can use it whenever you want. For example:

      print(name)
      print(age)

      When you run this code, Python will show:

      Alice
      25

      Important Rules for Naming Variables

      Summary

      Variables help you save information in Python so you can use it later. You can store words, numbers, or other things — all by just giving them a name!

      In the next lessons, you will learn more about working with different types of information!



      Welcome to ProgramGuru

      Sign up to start your journey with us

      Support ProgramGuru.org

      You can support this website with a contribution of your choice.

      When making a contribution, mention your name, and programguru.org in the message. Your name shall be displayed in the sponsors list.

      PayPal

      UPI

      PhonePe QR

      MALLIKARJUNA M