惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

V
Visual Studio Blog
N
Netflix TechBlog - Medium
GbyAI
GbyAI
大猫的无限游戏
大猫的无限游戏
博客园 - 三生石上(FineUI控件)
T
Tailwind CSS Blog
IT之家
IT之家
博客园 - Franky
雷峰网
雷峰网
博客园 - 聂微东
腾讯CDC
M
MIT News - Artificial intelligence
B
Blog RSS Feed
博客园_首页
罗磊的独立博客
S
SegmentFault 最新的问题
I
InfoQ
博客园 - 叶小钗
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
阮一峰的网络日志
阮一峰的网络日志
D
Docker
宝玉的分享
宝玉的分享
B
Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant
VARIABLE:
bhuvaneswari nandhagopal · 2026-05-31 · via DEV Community

A variable is a named container used to store data values so they can be referenced and manipulated later in the program.

Variable Naming Rules:(Alphanumeric)

1.Variable Name Must Start with a Letter or Underscore:
Correct:

name = "Ram"
_age = 20

Enter fullscreen mode Exit fullscreen mode

Wrong:
1name = "Ram"

Enter fullscreen mode Exit fullscreen mode

2.Variable Name Cannot Contain Spaces:
Wrong:
student name = "Ram"

Correct:
student_name = "Ram"

Use underscore _ instead of spaces.

3.Variable Names Can Contain Letters, Numbers, and Underscore:

Correct:

name1 = "Bhuvana"
student_mark = 95
print(name1, student_mark)

Enter fullscreen mode Exit fullscreen mode

Output:
Bhuvana 95

4.Special Characters Are Not Allowed:
Example:
@,#,!,&...

5.Python Keywords Cannot Be Used as Variable Names:

Wrong:
class = 10
for = 20
(class, for, if, while) are Python keywords.

6.Variable Names Are Case Sensitive:
Example:

name = "Ram"
Name = "Sam"
print(name)
print(Name)

Enter fullscreen mode Exit fullscreen mode

output:
Ram
Sam
name and Name are different variables.

Good Variable Names:

student_name = "Ram"
total_mark = 450
age = 20

Good variable names make programs easy to understand.

Data Types in Variables:
1.Integer
2.String
3.floating-point
4.Boolean

integer:
An integer is a whole number that can be positive, negative, or zero, without any fractional or decimal part.

Example:

age = 20
print(age)

Enter fullscreen mode Exit fullscreen mode

Output:
20

Here, 20 is an integer.

Integers can also be used for mathematical calculations.

Example:

a = 10
b = 20

print(a + b)
print(a - b)
print(a * b)

Enter fullscreen mode Exit fullscreen mode

output:
30
10
200

Integer:
10
25

String:
n Python, a string means text or words. Strings are written inside single quotes ' ' or double quotes " ".

Example:

print("Hello")
print('Hello')

Enter fullscreen mode Exit fullscreen mode

Output:
Hello
Hello

Both single quotes and double quotes work the same way in Python.

name = "Bhuvana"
print(name)

Enter fullscreen mode Exit fullscreen mode

output:
Bhuvana

Wrong Example:
print(Hello)

Correct Example:
print("Hello")

Strings are very important in Python because we use them to store names, messages, sentences, and other text data.

Floating-point:
A floating-point number means a number with a decimal point.

It is also called a float in Python.

Examples:

10.5
3.14
99.9
5.0

These are floating-point numbers because they contain decimal point.
Example:

temp = float(input("enter your body temperature:"))   
if temp > 100:
    print("you have fever.")
else:
    print("you do not have fever")

Enter fullscreen mode Exit fullscreen mode

output:
enter your body temperature:118
you have fever.

*Boolean: *
A Boolean has only two values:

True
False

Boolean is used to check conditions.

True Example:

is_student = True
print(is_student)

Enter fullscreen mode Exit fullscreen mode

output:
True

False Example:

is_raining = False
print(is_raining)

Enter fullscreen mode Exit fullscreen mode

output:
False