STRING FUNCTIONS TRB CSI › Python Programming › string functions and methods

STRING FUNCTIONS

String Function String மீது வேலை செய்யக்கூடிய Python built-in function.

Premium — locked Intermediate 27 min 460 cards 94 programs 8 MCQs v3
This is a premium lesson. You can see the shape of every card — unlock to read them. Unlock

STRING FUNCTIONS AND METHODS IN PYTHON Python-ல் String data-ஐ process செய்ய, analyze செய்ய, search செய்ய, mo……

Premium This card is part of the premium lesson. Unlock
Definition

String Function String மீது வ……

Premium This card is part of the premium lesson. Unlock
Explanation
General form

function(string) name = "Pyth……

Premium This card is part of the premium lesson. Unlock
Program
இங்கே
Explanation

ஒரு built-in function. String Method String object-க்கு already available-ஆ……

Premium This card is part of the premium lesson. Unlock
Explanation

இங்கே: upper() String method.…

Premium This card is part of the premium lesson. Unlock
Comparison
Function vs method

முதலில் இந்த difference மிகவும் தெளிவாக இரு……

Premium This card is part of the premium lesson. Unlock
Comparison
Difference
Concept
Important string concept

Python String immutable. அதனால் பெரும்பாலான String methods……

Premium This card is part of the premium lesson. Unlock
Explanation
Example

text = "python" text.upper()…

Premium This card is part of the premium lesson. Unlock

ஏன்? upper() original text-ஐ மாற்றவில்லை……

Premium This card is part of the premium lesson. Unlock
Algorithm

1. len()…

Premium This card is part of the premium lesson. Unlock
Definition

len() ஒரு String-ல் எத்தனை ch……

Premium This card is part of the premium lesson. Unlock
Explanation
Example

text = "Python"…

Premium This card is part of the premium lesson. Unlock
Explanation

P y t h o n Total: 6 characte……

Premium This card is part of the premium lesson. Unlock
Important

Space கூட ஒரு character.…

Premium This card is part of the premium lesson. Unlock
Explanation
Example

text = "Hello World"…

Premium This card is part of the premium lesson. Unlock
Program
Calculation
Algorithm

1. str()…

Premium This card is part of the premium lesson. Unlock

str() ஒரு value-ஐ String repr……

Premium This card is part of the premium lesson. Unlock
Explanation
Syntax

str(value)…

Premium This card is part of the premium lesson. Unlock
Program
Example

x முதலில் Integer. str(x) பிற……

Premium This card is part of the premium lesson. Unlock
Algorithm

1. type()…

Premium This card is part of the premium lesson. Unlock

type() variable அல்லது object……

Premium This card is part of the premium lesson. Unlock
Explanation
Example

text = "Python"…

Premium This card is part of the premium lesson. Unlock
Algorithm

1. max()…

Premium This card is part of the premium lesson. Unlock

String-ல் உள்ள characters-ல் Unicod……

Premium This card is part of the premium lesson. Unlock
Explanation
Example

text = "abc"…

Premium This card is part of the premium lesson. Unlock

இதற்கு alphabetical order மட்டும் காரணம் என்று நினைக……

Premium This card is part of the premium lesson. Unlock
Algorithm

1. min()…

Premium This card is part of the premium lesson. Unlock

String-ல் minimum character-ஐ……

Premium This card is part of the premium lesson. Unlock
Explanation
Example

text = "abc"…

Premium This card is part of the premium lesson. Unlock
Algorithm

1. sorted()…

Premium This card is part of the premium lesson. Unlock

String characters-ஐ sorted or……

Premium This card is part of the premium lesson. Unlock
Important

sorted() String return செய்யா……

Premium This card is part of the premium lesson. Unlock
Explanation
Example

text = "python"…

Premium This card is part of the premium lesson. Unlock
Algorithm

1. ord()…

Premium This card is part of the premium lesson. Unlock

ஒரு character-ன் Unicode code……

Premium This card is part of the premium lesson. Unlock
Program
Example
Program
Example
Algorithm

1. chr()…

Premium This card is part of the premium lesson. Unlock

ord()-க்கு opposite. Unicode numb……

Premium This card is part of the premium lesson. Unlock
Program
Example
Program
Example
Comparison
Ord vs chr
Program
Example

String methods-ஐ category-wise படித்தால் எளிதாக நினைவில் இருக்கும். Major categories: Case conversion methods……

Premium This card is part of the premium lesson. Unlock
Algorithm

1. upper()…

Premium This card is part of the premium lesson. Unlock

String characters அனைத்தையும் ……

Premium This card is part of the premium lesson. Unlock
Explanation
Syntax

string.upper() text = "python"…

Premium This card is part of the premium lesson. Unlock
Algorithm

1. lower()…

Premium This card is part of the premium lesson. Unlock

String characters அனைத்தையும்……

Premium This card is part of the premium lesson. Unlock
Explanation
Example

text = "PYTHON"…

Premium This card is part of the premium lesson. Unlock
Algorithm

1. capitalize()…

Premium This card is part of the premium lesson. Unlock

String-ன் முதல் character-ஐ upperca……

Premium This card is part of the premium lesson. Unlock
Explanation
Example

text = "python PROGRAMMING"…

Premium This card is part of the premium lesson. Unlock
Important

capitalize() எல்லா words-ன் first letter-ஐ uppercase ……

Premium This card is part of the premium lesson. Unlock
Important

1. title()…

Premium This card is part of the premium lesson. Unlock
Important

ஒவ்வொரு word-ன் beginning cha……

Premium This card is part of the premium lesson. Unlock
Explanation
Example

text = "python programming la……

Premium This card is part of the premium lesson. Unlock
Algorithm

1. swapcase()…

Premium This card is part of the premium lesson. Unlock

Uppercase-ஐ lowercase ஆகவும்,……

Premium This card is part of the premium lesson. Unlock
Explanation
Example

text = "PyThOn"…

Premium This card is part of the premium lesson. Unlock
Algorithm

1. casefold()…

Premium This card is part of the premium lesson. Unlock

casefold() aggressive lowercase c……

Premium This card is part of the premium lesson. Unlock
Explanation
Example

text = "PYTHON"…

Premium This card is part of the premium lesson. Unlock

Simple English strings-ல் lower() மற்றும் casefold() si……

Premium This card is part of the premium lesson. Unlock
Comparison
Case methods comparison
Comparison

1. find()…

Premium This card is part of the premium lesson. Unlock
Comparison

String-ல் ஒரு substring எங்கு fir……

Premium This card is part of the premium lesson. Unlock
Explanation
Syntax

string.find(value) text = "Py……

Premium This card is part of the premium lesson. Unlock
Explanation
Find with substring

text = "Python Programming" p……

Premium This card is part of the premium lesson. Unlock
Explanation
When value not found

text = "Python" print(text.fi……

Premium This card is part of the premium lesson. Unlock

Very important: find() substring க……

Premium This card is part of the premium lesson. Unlock
Algorithm

1. index()…

Premium This card is part of the premium lesson. Unlock

index() மற்றும் find() simila……

Premium This card is part of the premium lesson. Unlock
Explanation
Example

text = "Python"…

Premium This card is part of the premium lesson. Unlock
Comparison
Find vs index

Main difference: Substring not found என்ற……

Premium This card is part of the premium lesson. Unlock
Explanation
Example

text = "Python"…

Premium This card is part of the premium lesson. Unlock
Program
But
Common Mistake
Error

ValueError: substring not fou……

Premium This card is part of the premium lesson. Unlock
Common Mistake

1. rfind()…

Premium This card is part of the premium lesson. Unlock
Common Mistake

rfind() right side-லிருந்து search co……

Premium This card is part of the premium lesson. Unlock
Explanation
Example

text = "banana"…

Premium This card is part of the premium lesson. Unlock

Index: b a n a n a 0 1 2 3 4 ……

Premium This card is part of the premium lesson. Unlock
Algorithm

1. rindex()…

Premium This card is part of the premium lesson. Unlock

Last occurrence index return ……

Premium This card is part of the premium lesson. Unlock
Explanation
Example

text = "banana"…

Premium This card is part of the premium lesson. Unlock
Algorithm

1. count()…

Premium This card is part of the premium lesson. Unlock

ஒரு substring எத்தனை முறை occ……

Premium This card is part of the premium lesson. Unlock
Explanation
Example

text = "banana"…

Premium This card is part of the premium lesson. Unlock
Important
Count important

text = "aaaa" print(text.coun……

Premium This card is part of the premium lesson. Unlock

இந்த methods mostly Boolean v……

Premium This card is part of the premium lesson. Unlock
Algorithm

1. isalpha()…

Premium This card is part of the premium lesson. Unlock

String-ல் alphabetic characte……

Premium This card is part of the premium lesson. Unlock
Explanation
Example

text = "Python"…

Premium This card is part of the premium lesson. Unlock

But: text = "Python3"…

Premium This card is part of the premium lesson. Unlock

ஏனெனில் 3 number.…

Premium This card is part of the premium lesson. Unlock
Algorithm

1. isdigit()…

Premium This card is part of the premium lesson. Unlock

Digits மட்டும் உள்ளதா என்று c……

Premium This card is part of the premium lesson. Unlock
Explanation
Example

text = "12345"…

Premium This card is part of the premium lesson. Unlock

But: text = "123A"…

Premium This card is part of the premium lesson. Unlock
Algorithm

1. isalnum()…

Premium This card is part of the premium lesson. Unlock

Alphabet அல்லது Number characters ம……

Premium This card is part of the premium lesson. Unlock
Explanation
Example

text = "Python123"…

Premium This card is part of the premium lesson. Unlock

But: text = "Python 123"…

Premium This card is part of the premium lesson. Unlock

Reason: Space உள்ளது.…

Premium This card is part of the premium lesson. Unlock
Algorithm

1. isspace()…

Premium This card is part of the premium lesson. Unlock

Whitespace characters மட்டும்……

Premium This card is part of the premium lesson. Unlock
Explanation
Example

text = " "…

Premium This card is part of the premium lesson. Unlock
Algorithm

1. islower()…

Premium This card is part of the premium lesson. Unlock

String-ல் உள்ள cased letters ……

Premium This card is part of the premium lesson. Unlock
Explanation
Example

text = "python"…

Premium This card is part of the premium lesson. Unlock
Algorithm

1. isupper()…

Premium This card is part of the premium lesson. Unlock

Cased letters அனைத்தும் upper……

Premium This card is part of the premium lesson. Unlock
Explanation
Example

text = "PYTHON"…

Premium This card is part of the premium lesson. Unlock
Algorithm

1. istitle()…

Premium This card is part of the premium lesson. Unlock

String title case format-ல் இ……

Premium This card is part of the premium lesson. Unlock
Explanation
Example

text = "Python Programming"…

Premium This card is part of the premium lesson. Unlock
Algorithm

1. isdecimal()…

Premium This card is part of the premium lesson. Unlock

String decimal characters மட்……

Premium This card is part of the premium lesson. Unlock
Explanation
Example

text = "123"…

Premium This card is part of the premium lesson. Unlock
Algorithm

1. isnumeric()…

Premium This card is part of the premium lesson. Unlock

Numeric characters உள்ளதா என்……

Premium This card is part of the premium lesson. Unlock
Explanation
Example

text = "123"…

Premium This card is part of the premium lesson. Unlock
Comparison
Isdecimal vs isdigit vs isnumeric

Basic ASCII numbers-க்கு: text = "123" இந்த மூன்றும் பொதுவாக: True return செய்யும். Conceptual……

Premium This card is part of the premium lesson. Unlock
Comparison

1. isidentifier()…

Premium This card is part of the premium lesson. Unlock
Comparison

ஒரு String valid Python identi……

Premium This card is part of the premium lesson. Unlock
Explanation
Example

name = "student_name"…

Premium This card is part of the premium lesson. Unlock

But: name = "2student"…

Premium This card is part of the premium lesson. Unlock
Important

isidentifier() syntax validit……

Premium This card is part of the premium lesson. Unlock
Program
Example

for keyword ஆனாலும் identifier lex……

Premium This card is part of the premium lesson. Unlock
Algorithm

1. isprintable()…

Premium This card is part of the premium lesson. Unlock

String printable characters ம……

Premium This card is part of the premium lesson. Unlock
Explanation
Example

text = "Python 123"…

Premium This card is part of the premium lesson. Unlock
Algorithm

1. isascii()…

Premium This card is part of the premium lesson. Unlock

String-ல் உள்ள characters ASC……

Premium This card is part of the premium lesson. Unlock
Explanation
Example

text = "Python"…

Premium This card is part of the premium lesson. Unlock
Algorithm

1. strip()…

Premium This card is part of the premium lesson. Unlock

Beginning மற்றும் ending-ல் உ……

Premium This card is part of the premium lesson. Unlock
Explanation
Example

text = " Python "…

Premium This card is part of the premium lesson. Unlock

Middle space remove ஆகாது.…

Premium This card is part of the premium lesson. Unlock
Explanation
Example

text = " Python Programming "…

Premium This card is part of the premium lesson. Unlock
Algorithm

1. lstrip()…

Premium This card is part of the premium lesson. Unlock

Left side whitespace remove ச……

Premium This card is part of the premium lesson. Unlock
Explanation
Example

text = " Python "…

Premium This card is part of the premium lesson. Unlock
Explanation

Result conceptually: Python R……

Premium This card is part of the premium lesson. Unlock
List

1. rstrip()…

Premium This card is part of the premium lesson. Unlock
Explanation

Right side whitespace remove ……

Premium This card is part of the premium lesson. Unlock
Explanation

Left spaces remain.…

Premium This card is part of the premium lesson. Unlock
Explanation
Strip with characters

strip() spaces மட்டும் அல்ல. Specified ch……

Premium This card is part of the premium lesson. Unlock
Concept
Important strip concept

strip("abc") exact substring "abc"-ஐ remove செய்யும் என்று நின……

Premium This card is part of the premium lesson. Unlock
Explanation
Example

text = "abcPythoncab"…

Premium This card is part of the premium lesson. Unlock

ஒரு substring-ஐ வேறு substrin……

Premium This card is part of the premium lesson. Unlock
Explanation
Syntax

string.replace(old, new) text……

Premium This card is part of the premium lesson. Unlock
Explanation
Immutability connection

text = "Java" text.replace("J……

Premium This card is part of the premium lesson. Unlock
Program
Correct
Explanation
Replace count

Third argument கொடுக்கலாம். r……

Premium This card is part of the premium lesson. Unlock

First two occurrences மட்டும் r……

Premium This card is part of the premium lesson. Unlock
Algorithm

1. split()…

Premium This card is part of the premium lesson. Unlock

ஒரு String-ஐ multiple parts-ஆ……

Premium This card is part of the premium lesson. Unlock
Explanation
Example

text = "Python Java C"…

Premium This card is part of the premium lesson. Unlock
Important

split() return type: List Str……

Premium This card is part of the premium lesson. Unlock
Explanation
Split with separator

text = "Python,Java,C" print(……

Premium This card is part of the premium lesson. Unlock

Comma separator-ஆ use செய்யப்……

Premium This card is part of the premium lesson. Unlock
Algorithm

1. rsplit()…

Premium This card is part of the premium lesson. Unlock

Right side-லிருந்து split ope……

Premium This card is part of the premium lesson. Unlock
Explanation
Example

text = "a-b-c"…

Premium This card is part of the premium lesson. Unlock
Algorithm

1. splitlines()…

Premium This card is part of the premium lesson. Unlock

Multiple lines-ஐ List of line……

Premium This card is part of the premium lesson. Unlock
Explanation
Example

text = "Python\nJava\nC"…

Premium This card is part of the premium lesson. Unlock
Algorithm

1. partition()…

Premium This card is part of the premium lesson. Unlock

ஒரு separator அடிப்படையில் St……

Premium This card is part of the premium lesson. Unlock
Explanation
Syntax

string.partition(separator)…

Premium This card is part of the premium lesson. Unlock
Program
Example
Important

partition() Tuple return செய்……

Premium This card is part of the premium lesson. Unlock
Output
Result
Algorithm

1. rpartition()…

Premium This card is part of the premium lesson. Unlock

Last occurrence separator அடி……

Premium This card is part of the premium lesson. Unlock
Explanation
Example

text = "a-b-c"…

Premium This card is part of the premium lesson. Unlock
Comparison
Split vs partition
Comparison

CATEGORY 7: JOIN METHOD join() Multi……

Premium This card is part of the premium lesson. Unlock
Explanation
Syntax

separator.join(iterable) இந்த syntax ஆரம்பத்தில் கொஞ……

Premium This card is part of the premium lesson. Unlock
Flow
Join flow

words = ["Python", "Java", "C……

Premium This card is part of the premium lesson. Unlock
Output
Result
Explanation
Join with comma

words = ["Python", "Java", "C……

Premium This card is part of the premium lesson. Unlock
Common Mistake
Common error in join

values = [10, 20, 30] print(",".join(values)) Error வரும். ……

Premium This card is part of the premium lesson. Unlock
Algorithm

1. startswith()…

Premium This card is part of the premium lesson. Unlock

String குறிப்பிட்ட text-ஆ sta……

Premium This card is part of the premium lesson. Unlock
Explanation
Example

text = "Python Programming"…

Premium This card is part of the premium lesson. Unlock
Algorithm

1. endswith()…

Premium This card is part of the premium lesson. Unlock

String குறிப்பிட்ட text-ஆ end……

Premium This card is part of the premium lesson. Unlock
Explanation
Example

file = "notes.pdf"…

Premium This card is part of the premium lesson. Unlock

Real-time use: File extension……

Premium This card is part of the premium lesson. Unlock
Algorithm

1. center()…

Premium This card is part of the premium lesson. Unlock

String-ஐ specified width-ல் c……

Premium This card is part of the premium lesson. Unlock
Explanation
Example

text = "Python"…

Premium This card is part of the premium lesson. Unlock
Explanation

Conceptual result: Python…

Premium This card is part of the premium lesson. Unlock
List

1. ljust()…

Premium This card is part of the premium lesson. Unlock
Explanation

Left align செய்யும். text = "……

Premium This card is part of the premium lesson. Unlock
List

1. rjust()…

Premium This card is part of the premium lesson. Unlock
Explanation

Right align செய்யும். text = ……

Premium This card is part of the premium lesson. Unlock
Explanation
Fill character

text = "Python" print(text.ce……

Premium This card is part of the premium lesson. Unlock
Algorithm

1. zfill()…

Premium This card is part of the premium lesson. Unlock

String-ன் left side-ல் zeros ……

Premium This card is part of the premium lesson. Unlock
Explanation
Example

text = "25"…

Premium This card is part of the premium lesson. Unlock

Useful: 001 002 003 போன்ற fixed-widt……

Premium This card is part of the premium lesson. Unlock
Algorithm

1. removeprefix()…

Premium This card is part of the premium lesson. Unlock

Specific prefix இருந்தால் அதை……

Premium This card is part of the premium lesson. Unlock
Explanation
Example

text = "Mr.Ravi"…

Premium This card is part of the premium lesson. Unlock

Prefix இல்லை என்றால் original……

Premium This card is part of the premium lesson. Unlock
Algorithm

1. removesuffix()…

Premium This card is part of the premium lesson. Unlock

Specific suffix இருந்தால் rem……

Premium This card is part of the premium lesson. Unlock
Explanation
Example

file = "notes.pdf"…

Premium This card is part of the premium lesson. Unlock
Comparison
Remove prefix vs lstrip

முக்கிய difference. removeprefix() Exact prefix remove செய்யும். lstrip() c……

Premium This card is part of the premium lesson. Unlock
Comparison

1. format()…

Premium This card is part of the premium lesson. Unlock
Comparison

Values-ஐ String உள்ளே insert ……

Premium This card is part of the premium lesson. Unlock
Program
Example
Explanation

text = "My name is {} and I a……

Premium This card is part of the premium lesson. Unlock
Explanation
Positional format

text = "{0} learns {1}".forma……

Premium This card is part of the premium lesson. Unlock
Explanation
Named format

text = "{name} learns {course}"……

Premium This card is part of the premium lesson. Unlock
Explanation
F-string

Modern Python-ல் f-string மிக……

Premium This card is part of the premium lesson. Unlock
Program
Example
Comparison
Format method vs f-string

Format method: "Name: {}".format(name) F-string: f"Name: {……

Premium This card is part of the premium lesson. Unlock
Comparison

1. maketrans()…

Premium This card is part of the premium lesson. Unlock
Comparison

Character translation mapping……

Premium This card is part of the premium lesson. Unlock
Comparison

1. translate()…

Premium This card is part of the premium lesson. Unlock
Comparison

Mapping அடிப்படையில் characte……

Premium This card is part of the premium lesson. Unlock
Program
Example
Explanation

text = "abc"…

Premium This card is part of the premium lesson. Unlock

Mapping: a -> 1 b -> 2 c -> 3…

Premium This card is part of the premium lesson. Unlock
Explanation
Encode method

encode() String-ஐ bytes repre……

Premium This card is part of the premium lesson. Unlock

Default encoding பொதுவாக UTF-……

Premium This card is part of the premium lesson. Unlock
Explanation
Expandtabs method

Tabs-ஐ spaces-ஆ expand செய்யு……

Premium This card is part of the premium lesson. Unlock
Explanation

Tab stops அடிப்படையில் spacin……

Premium This card is part of the premium lesson. Unlock
Explanation
String methods return types

இது exam-க்கு மிகவும் முக்கிய……

Premium This card is part of the premium lesson. Unlock
Explanation

text = " Python Programming "…

Premium This card is part of the premium lesson. Unlock
Explanation

text.upper() New uppercase String return செய்கிறது. text.lower() New lowercase String return செய்கிறது. text.……

Premium This card is part of the premium lesson. Unlock
Real Life Example
Real-time example 1: username validation

username = "student369" if usern……

Premium This card is part of the premium lesson. Unlock
Real Life Example
Real-time example 2: file type

filename = "notes.pdf" if fil……

Premium This card is part of the premium lesson. Unlock
Real Life Example
Real-time example 3: search

message = "Learn Python Program……

Premium This card is part of the premium lesson. Unlock
Important
Note

in என்பது String method அல்ல.……

Premium This card is part of the premium lesson. Unlock
Input
Real-time example 4: clean input

User input clean செய்ய strip(……

Premium This card is part of the premium lesson. Unlock
Real Life Example
Real-time example 5: csv-like data

data = "101,Ravi,Computer Sci……

Premium This card is part of the premium lesson. Unlock
Explanation
Method chaining

String methods ஒன்றன் result மீது இன……

Premium This card is part of the premium lesson. Unlock

Flow: Original " python programming "……

Premium This card is part of the premium lesson. Unlock
Explanation
Multiple method chaining

text = " python programming " result =……

Premium This card is part of the premium lesson. Unlock

Flow: strip() python programming ……

Premium This card is part of the premium lesson. Unlock
Important

Method chaining works because one method returns an object on w……

Premium This card is part of the premium lesson. Unlock
Explanation
Example

text.find("P") returns an Integer. So: text……

Premium This card is part of the premium lesson. Unlock
Common Mistake
Common error 1

Incorrect: text = "python" text.upper() print(t……

Premium This card is part of the premium lesson. Unlock
Common Mistake
Common error 2

Incorrect: text = "Python" print(text.find()……

Premium This card is part of the premium lesson. Unlock
Common Mistake
Common error 3

text = "Python" print(text.in……

Premium This card is part of the premium lesson. Unlock
Common Mistake
Error

ValueError Safer search where……

Premium This card is part of the premium lesson. Unlock
Common Mistake
Common error 4

numbers = [1, 2, 3] "-".join(……

Premium This card is part of the premium lesson. Unlock
Common Mistake
Error.

Because items must be strings. Corr……

Premium This card is part of the premium lesson. Unlock
Common Mistake
Common error 5

Confusing: split() and: join()…

Premium This card is part of the premium lesson. Unlock
Remember

split One String to many part……

Premium This card is part of the premium lesson. Unlock
Comparison
Comparison: split vs join

Split: text = "A B C" print(t……

Premium This card is part of the premium lesson. Unlock

Join: data = ['A', 'B', 'C']…

Premium This card is part of the premium lesson. Unlock

Memory: String -> List split(……

Premium This card is part of the premium lesson. Unlock
Comparison
Comparison: find vs count
Definition
Meaning

First occurrence location. co……

Premium This card is part of the premium lesson. Unlock
Definition
Meaning

Total occurrences.…

Premium This card is part of the premium lesson. Unlock
Comparison
Comparison: upper vs isupper

upper() converts. text.upper() returns a String. isupper……

Premium This card is part of the premium lesson. Unlock
Comparison
Comparison: alpha, digit, alnum

Given: "Python" isalpha() -> True isdigit() -> False isalnum() -> True Given: "123" isalpha() -> False isdig……

Premium This card is part of the premium lesson. Unlock
Memory Trick

Case conversion: upper lower capitalize title swapcase Searching: find index rfind rindex cou……

Premium This card is part of the premium lesson. Unlock
TRB Point

Important TRB facts: Python String is immutable. len() is a built-in function. upper() is a String method. fi……

Premium This card is part of the premium lesson. Unlock
Interview Point
Question

What is the difference between a function and a method in Python? Answer: A function is ca……

Premium This card is part of the premium lesson. Unlock
Interview Point
Question

Does replace() modify a String? Answer: No. Strings……

Premium This card is part of the premium lesson. Unlock
Interview Point
Question

Difference between find() and index()? Answer: Bot……

Premium This card is part of the premium lesson. Unlock
Interview Point
Question

Difference between split() and join()? Answer: split() converts one S……

Premium This card is part of the premium lesson. Unlock
MCQ

What is the output? text = "p……

Premium This card is part of the premium lesson. Unlock
MCQ

Which one is a built-in funct……

Premium This card is part of the premium lesson. Unlock
MCQ

What does find() return when ……

Premium This card is part of the premium lesson. Unlock
MCQ

What happens if index() canno……

Premium This card is part of the premium lesson. Unlock
MCQ

What is the return type of sp……

Premium This card is part of the premium lesson. Unlock
MCQ

What is the output? text = "P……

Premium This card is part of the premium lesson. Unlock
Mcq 7

What is the output? text = "Python 123" print(t……

Premium This card is part of the premium lesson. Unlock
Mcq 8

What is the output? text = "b……

Premium This card is part of the premium lesson. Unlock
Mcq 9

What is the output? text = "P……

Premium This card is part of the premium lesson. Unlock
Mcq 10

What is the output? text = "not……

Premium This card is part of the premium lesson. Unlock
MCQ

Which method removes whitespa……

Premium This card is part of the premium lesson. Unlock
MCQ

Which method combines multipl……

Premium This card is part of the premium lesson. Unlock
Practice

Given: text = " Python Programming " Find the output: print(text.strip()) print(text.upper()) print(text.lowe……

Premium This card is part of the premium lesson. Unlock
Table
Important complete table
Summary

String Functions and Methods are used to process String data. Function example: len(text) Method example: tex……

Premium This card is part of the premium lesson. Unlock
Explanation
Short description

String functions and methods are Python operations used to inspect, search, validate, clean, transform, split……

Premium This card is part of the premium lesson. Unlock
Text size
17px
Theme
Contents
Print / PDF
Program