Python – Variables

Variables in Python

Variables are used to store data values. A variable is created the moment you first assign a value to it.

Rules for Naming Variables

  • Variable names must start with a letter (a-z, A-Z) or an underscore (_).
  • Variable names can contain letters, numbers (0-9), and underscores.
  • Variable names are case-sensitive (e.g., myVar and myvar are different variables).

Assigning Values to Variables

You can assign values to variables using the assignment operator (=).

# Assigning values to variables
name = "Alice"
age = 30
height = 5.7
is_student = True

Tutorials Deck

TutorialsDeck is striving to provide the best learning material on technical and non-technical subjects.

Languages

Web Technologies

Database

Trending Technologies

© 2024. All rights reserved.

Contact Us @ tutorialsdeck06@gmail.com