How To Use String In Python

Hello Friends Me Aapko Aaj String Function ke Bare me batane wala hu Jisse aap String Function Learn kar Sakte Hai.

String In Python

String in python

What is String ?

String ek data type hota hai. Collection of Character String python me us time use karte hai jahah pr Hme ek se jyada character use karne padte hai. Example :- “Masterprograming” |

String ko understand karne ke liye ham kuch example se samnjte hai .

Example :

Name = "Masterprogramming"      #string 
print(name)

Output

Mastrprogramming

Ye to hua string ka example :

String Concatenation

What is String Concatenation

String Concatenation two string ko add karna hota hai . ye string concatenation kahlata hai.

Two String ko Add karne ke liye ham example se samanjte hai.

Example

first_name = Master"                       #string
last_name = "Programming"                  #string

#add two string
full_name = first_name + last_name

print(full_name)

String Ouput

MasterProgramming

Ye to hua string ka example :

How To Use Str() Function

String me number ko use karne ke liye aapko Str() Function ka use karna padta hai. lekin ham isse example ke sath dekhte hai.

How to use str() function

Example

a = "masterprogramming"
print(a + str('3'))    # use str function

Output

masterprogramming3

Leave a Reply

Your e-mail address will not be published. Required fields are marked *