Python String Format | How To use String Formatting Python

Python String FormatString Formating kiya, hoti hai or “python string” kyo use ki jati hai And python string format ka kiya work hota hai. why python format important in string formatting python Let See

Python String Format

String Formatting Video Hindi & Urdu

What is String Formatting ?

String formatting python me isliye use hoti hai. Taki Syntax ko little kar sake And string format ka use variable ko lekar print kara Sake| string formatting python me three type ki hoti. is post me ham three type ke example dekhte hai |

http://masterprograming.com/python-string-format/
Python String Format

How To Use String In Python

Python string

Pahle Ham With out String Formatting ke program banate hai And After that String Formatting ka program banate hai.

Without String Formatting Example Program :

name = "danish"
age  = "24"                            #string variable becoz " "

print("Hello" + name, "Your Age Is" + age)       # name , age variable

Without String Formatting Program output :

Hello danish your age is 24                  

Dosto Aap Dekh Sakte hai program me jab mene print karaya to kuch jyada dikkat kar de ne wala program hai . lekin isse se bachne ke liye ham log string format ka use karte hai |

Python String format

String Format ko understand karne ke liye ham string formatting ka use karne wale or jo hamne pahle program banaya tha wo hi same program ham string format ka use karke banane wale hai |

Example :

name = "danish"
age  = "24"                            #string variable becoz " "

print("Hello {} Your Age Is {}".format(name,age))   #name ,age variable

Python String Format me { } (curly braces) open hota hai or iske inside me variable ka use hota hai . lekin aap .format ( ) ke variable likh kar print kara sakte hai.

Output :

Hello danish your age is 24    

Aap Dekh sakte hai first program and second program ka output bilkul same hai. lekin python string format ka use karke syntax aashan ho jata hai.

string formating

Python String Format Ka Sabse Aashan Tarika Dekhte hai . ye sabse jyada use hota hai hai python string format me. Iska bhi ham same program banate hai or iska example Dekhte hai |

How To Use Input Function in Python

String Format Example

Example :

name = "danish"
age  = "24"                            #string variable becoz " "

#best method string formatting

print(f"Hello {name} Your Age Is {age}") 

Python String Format Me aap dekh sakte hai jab hamne isme print kraya to Double Code ” “ se small ( f ) ka use kiya iska matlab hota f means format And { } (curly braces) ke inside me variable ka use hota hai |

Output

Hello danish your age is 24    

Agar Aap Sab Example ke output dekhe to output bilkul same milega or string formatting ka use karke syntax ko bhi aashan kar diya hai | Issi Tarah Se Python Format String ka use hota hai python me |

Dosto mujhe ummed hai ki aap Python String Format ko acchi tarah se samanj gye honge agar aap ko ye post acchi lage to mere is website ko jarur follow kre or ha agar aap video bhi dekhna chahte hai to aap mere channel ko bhi subscribe kar sakte hai. channel ka link aapko home page par mil jayega |

Please follow and like us:
error
Summary
Review Date
Reviewed Item
Python String Formating
Author Rating
51star1star1star1star1star

Danish Ali

I Am a 1st Sem BCA Student & I have Skills C, C++ ,Python, HTML,CSS, Computer & Advance Hacking & Blogger & YouTuber.

Leave a Reply

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