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

推荐订阅源

雷峰网
雷峰网
L
LangChain Blog
GbyAI
GbyAI
F
Fortinet All Blogs
腾讯CDC
Last Week in AI
Last Week in AI
A
About on SuperTechFans
J
Java Code Geeks
Microsoft Azure Blog
Microsoft Azure Blog
博客园 - Franky
B
Blog
D
Docker
G
Google Developers Blog
月光博客
月光博客
博客园 - 三生石上(FineUI控件)
S
SegmentFault 最新的问题
Apple Machine Learning Research
Apple Machine Learning Research
酷 壳 – CoolShell
酷 壳 – CoolShell
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
T
Tailwind CSS Blog
宝玉的分享
宝玉的分享
U
Unit 42
Blog — PlanetScale
Blog — PlanetScale
B
Blog RSS Feed

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
Day 2 of Python Learning 🐍
Vairavan · 2026-05-27 · via DEV Community

Vairavan

Vairavan

Posted on • Edited on

Last day, we learned terminal basics, conditional statements, how to use Boolean datatype in Python, and what dynamic type is. Today, we will see some more things that I learned in Python.
I learned was Control Flow Statements.

Control Flow Statement

Control Flow Statements are used to control the execution flow of a program type of three.

1.Condition Statements
2.Lopping Statements
3.Jump Statements

Today we are going to learn two statements.😁
One is Conditional Statements, and another one is Looping Statements.

Condition Statements

Condition statement means checking a condition and running the code based on that condition.

Condition Statement key words

  • if
  • else
  • elif 🤔

In JavaScript, I used else if.
In Python, we use elif for the same purpose. ( else + if = elif 😜 )

a =10
b =20
c =21
if a>=b and a>=c:
    print(a)
elif b>=a and b>=c:
    print(b)
elif c>=a and c>=b:
    print (c)

OutPut:
   c

  • First I created three variables and assigned values to them.
  • Then I used an if-elif condition statement to check which value is greater.
  • Used to (ex) a>=b and a>=c, b>=a and b>=c, c>=a and c>=b
  • Finally the program prints the largest number.📈

Looping Conditions

A looping condition is used to repeat a block of code again and again until the condition becomes false. two Type of Looping Conditions is Here
For Loop Condition and While Loop Conditions. but I Today only Learn in While Loop Condition.

While Loop

It is used to run the code until the condition becomes false.
I was create a while loop conditions by 4 task. see the task easy to Understand in while loop condition..

Task no: 1) 5 4 3 2 1

count =5
while count>=1:
    print(count, end=" ")
    count-=1
Output :
5 4 3 2 1
------------------------------

Task no: 2) 10 8 6 4 2

loop=10
while loop>= 2:
    print(loop, end=" ")
    loop-=2
Output :
10 8 6 4 2

------------------------------

Task no3) 15 12 9 6 3

count1 =15
while count1>=3:
    print(count1,end=" ")
    count1-=3
Output :
15 12 9 6 3

------------------------------

Task no:4) 25 20 15 10 5

count2 =25
while count2>=5:
    print(count2,end=" ")
    count2-=5
Output :
25 20 15 10 5

EX :

Task no 1
Full program flow:

  • Create a Variable and Initialization starting value. count = 5
  • Used a while Loop condition and Check the Condition. while count>=1:
  • print the Count. print( Count )
  • value decrease. count-=1 meaning count=5 > > 5 - 1 = 4 > > count =4
  • again condition check. count value = 4 again print and again decrement the count.
  • When the condition becomes false the loop stops. [ex] count is 0 >=1.

And I use All print inside end=" "

what is this end=""🤔

  • end="" is used to control what comes after the print output.
  • Normally print moves to the next line.😒
OutPut:

5
4              
3
2
1

  • But using end="" we can print output in the same line.😃
OutPut :

5 4 3 2 1       

  • We can use space, star, dash, or other symbols inside end="".😯
end="*",end="_"

OutPut :

5*4*3*2*1

5_4_3_2_1

I will continue my Python journey tomorrow...👋