0% found this document useful (0 votes)
4 views1 page

Python Strings: Basics & Functions Guide

This document provides an overview of strings in Python, explaining their definition, indexing, slicing, concatenation, and immutability. It also covers string functions, escape characters, formatting methods, and common programs related to strings. Key exam points highlight the immutability of strings, indexing starting from 0, and the efficiency of f-strings.

Uploaded by

av3434564
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)
4 views1 page

Python Strings: Basics & Functions Guide

This document provides an overview of strings in Python, explaining their definition, indexing, slicing, concatenation, and immutability. It also covers string functions, escape characters, formatting methods, and common programs related to strings. Key exam points highlight the immutability of strings, indexing starting from 0, and the efficiency of f-strings.

Uploaded by

av3434564
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

STRING IN PYTHON – Hinglish Notes

1. What is a String?
String ek sequence of characters hoti hai jo single, double ya triple quotes me likhi jaati hai. Python
me strings immutable hoti hain.

Example:
name = "Arun"
city = 'Delhi'

2. String Indexing
Indexing se hum characters ko position ke through access karte hain. Index 0 se start hota hai.

Example:
s = "Python"
s[0] → P
s[-1] → n

3. String Slicing
Slicing ka matlab string ka ek part nikalna. End index include nahi hota.

Example:
s[0:4] → Pyth
s[::-1] → Reverse string

4. String Concatenation
Do ya zyada strings ko + operator se joda jaata hai.

5. String Functions
upper(), lower(), capitalize(), title(), strip(), replace(), find(), count(), split(), join()

6. String Immutability
String ke characters directly change nahi kiye ja sakte.

7. Escape Characters
\n – New line, \t – Tab, \\ – Backslash

8. String Formatting
Old style (%), format(), aur f-strings (recommended).

9. Common Programs
Reverse string, Palindrome check, Vowel count.

Important Exam Points


• Strings are immutable
• Indexing starts from 0
• f-strings fastest hote hain

You might also like