0% found this document useful (0 votes)
11 views3 pages

Python Programming Ka Parichay

The document is an introduction to Python programming, authored by Udayan Das, Aubrey Lawson, Chris Mayfield, and Narges Norouzi, and published by OpenStax, Rice University. It outlines the structure of the textbook, including chapters on statements, expressions, objects, and more, along with guidelines for attribution when reproducing the material. The first chapter discusses basic programming concepts like the 'Hello, World!' program, input/output functions, and variables in Python.

Uploaded by

dropshipland5
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views3 pages

Python Programming Ka Parichay

The document is an introduction to Python programming, authored by Udayan Das, Aubrey Lawson, Chris Mayfield, and Narges Norouzi, and published by OpenStax, Rice University. It outlines the structure of the textbook, including chapters on statements, expressions, objects, and more, along with guidelines for attribution when reproducing the material. The first chapter discusses basic programming concepts like the 'Hello, World!' program, input/output functions, and variables in Python.

Uploaded by

dropshipland5
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Python Programming ka Parichay

Mukhya Yogdan Karne Waale Lekhak: Udayan Das, Aubrey Lawson, Chris Mayfield, Narges Norouzi
OpenStax, Rice University
©2024 Rice University. OpenStax dwaara prastut pathya pustak ki samagri Creative Commons Attribution
4.0 Antarashtriya License ke antargat uplabdh hai.
- Yadi aap is pathya pustak ko digital format (PDF, HTML, aadi) mein punarvitran karte hain, to har prishth
par nimn likhit attribution banae rakhna hoga: “openstax.org se muft prapt karein.”
- Yadi aap is pathya pustak ko chhap kar punarvitran karte hain, to har prishth par nimn likhit attribution
hona chahiye: “openstax.org se muft prapt karein.”
- Yadi aap is pustak ka kuch hissa digital ya printed format mein punarvitran karte hain, to har page par
“openstax.org se muft prapt karein” attribution honi chahiye.

Vishay Suchi (Table of Contents)


• Mukhyalekh (Preface) ............................................... 1
• Adhyay 1: Vakyansh (Statements) ......................... 7–34
• Adhyay 2: Abhivyaktiyaan (Expressions) .................. 39–67
• Adhyay 3: Vastuen (Objects) .............................. 71–88
• Adhyay 4: Nirnay (Decisions) .............................. 91–118
• Adhyay 5: Punaravriti (Loops) ......................... 121–140
• Adhyay 6: Karya (Functions) ........................... 145–170
• Adhyay 7: Module (Modules) ................................ 173–194
• Adhyay 8: Strings .............................................. 197–220
• Adhyay 9: Suchiyan (Lists) ................................. 223–238
• Adhyay 10: Shabdkosh (Dictionaries) .............. 241–260
• Adhyay 11: Kaksha (Classes) .............................. 265–283
• Adhyay 12: Punaravriti Vistarit (Recursion) ......... 287–301
• Adhyay 13: Uttardhairya (Inheritance) ................ 303–323
• Adhyay 14: File .................................................. 327–347
• Adhyay 15: Data Vigyan (Data Science) ................ 349–375
• Answer Key (Uttar Sankalan) ................................ 379–402
• Suchi (Index) ............................................... 403–end

Adhyay 1: Vakyansh (Statements)


1.1 Prishthbhoomi (Background)

Ek parampara ke mutabik, Hello World (https://openstax.org/r/100helloworld) ko pehla program mana jata


hai jab koi nayi programming bhaasha seekh raha ho. Ye program sirf user ko "Hello, World!"
sandesh dikhata hai. Python mein Hello World program keval ek line ka hota hai:

1
print("Hello, World!")

Yeh code Python interpreter ko nirdesh deta hai ki console par Hello, World! message print kare. Vipareet
roop se, Hello World program Java (ek alag bhaasha) mein paanch lines ka hota hai, kyunki Java mein extra
class aur method declarations ki jarurat hoti hai:

public class Hello {


public static void main(String[] args) {
System.out.println("Hello, World!");
}
}

Java mein is prakar adhik syntax ki jarurat hone ke karan program lamba hota hai. Har bhaasha ka apna
vyavahaar aur istemal hota hai; ek vishesh pariyojna ke liye alag bhaasha adhik upyukt ho sakti hai.
Udaharan ke liye, Android apps ke development mein aksar Java ka istemal kiya jata hai.

1.2 Input/Output

Learning Objectives:
- print() function ka upyog karke output pradarshit karna.
- input() function ka upyog karke user se pravesh (input) prapt karna.

Basic Output: print() function screen par output dikhane ke liye upyog hota hai. Output vah jankari ya
parinaam hai jo program produce karta hai. sep aur end options ka upyog output ko customize karne
ke liye kiya ja sakta hai. Nimn code examples me print() function ka prayog dikhaya gaya hai:

print("Today is Monday.")
print("I like string beans.")

Upar wale code do alag lines me do vaakya print karega:

Today is Monday.
I like string beans.

print("Today", "is", "Monday", sep="...")


print("I like string beans.")

Is udaharan me sep="..." ka prayog kiya gaya hai, jisse pehle line me shabdon ke beech mein ... jud
jata hai. Output hoga:

2
Today...is...Monday
I like string beans.

By default, print() function har output ke ant me newline character jod deta hai, jisse output agle line se
shuru hota hai. Agar ek hi line me output jari rakhni ho to end argument ka upyog kiya ja sakta hai.
Udaharan ke liye:

print("Today is Monday, ", end="")


print("I like string beans.")

Is example me, pehle print() me end="" specify kiya gaya hai, jisse console me cursor usi line par
bana rahata hai. Iska output hoga:

Today is Monday, I like string beans.

1.3 Char (Variables)

Python me variable ek naam hai jo kisi maan (value) ko store karta hai. Jaise:

count = 0

Is statement me count naam ke variable ko integer 0 assign kiya gaya hai. Aage ke sections me hum
variable ke vistaar se upyog aur samjhenge.

(Anya subsections jaise 1.4, 1.5, ... bhi isi tarah Roman Hindi me anudit rahenge.)

```markdown

(Yeh praroop keval udaharan ke liye hai. Pura pustak anuvad bahut vistaarak hoga, sabhi adhyayon aur sections
ke saath.)

You might also like