369 TESLAKALVIYOGI
Page 10 of 30

Variable Naming Rules

Rules, mistakes, good variable names

</> logic
1

Concept Meaning

Variable names should be meaningful, clear, and follow language rules.

2

Real-Life Analogy

A labeled box helps us find the correct item quickly. A good variable name helps us understand code quickly.

3

Expected Output

studentName, totalMarks, isPass
4

Common Mistake

Do not start with numbers, use spaces, or use symbols like @ and #.

Same Logic • Different Syntax

Code in 4 Languages

JavaScript
let studentName="Ravi";
let totalMarks=480;
C++
string studentName="Ravi";
int totalMarks=480;
Python
student_name="Ravi"
total_marks=480
PHP
<?php
$studentName="Ravi";
$totalMarks=480;
?>

Memory Tip

Clear names = clear coding.