How To use Row String in python

Row String In python

Hello Friends Aaj Ham Learn Karte hai Row String ke bare me row string kiya hai . or ham ise kyo use karte hai . ye sab ham janenge is post me.

Row String Ko Ham Jab Use Karte hai jab hamme koi escape sequence ko print karana . Example ..

How To Use Row String in python

Pahle Ham Bina Row String ke Example Dekhte hai .

Example

print("Line A \n Line B")

Agar ham is tarah se print karte hai to ye To hame ye output milta hai.

Output

Line A
Line B

Lekin Ham Row String ka use karke bhi ( \n ) ka use kar sakte hai . wo bhi string ki tarah .

Agar Hame Escape Sequence ka Ko string ka tarah use karna ho to hame row string karna padta hai

Example

print(r"Line A \n Line B")

Output

Line A \n Line B

Aap Dekh Sakte hai ki hamne row string ko use karke ek line me print kara diya hai . issi tarah ham row string ko use karte hai .

Row String ko use karne ke liye Appko starting me small ( r ) ka use karna padta hai .

Danish Ali

I Am a Cyber Security Student & I have Skills C, C++ ,Python, HTML,CSS, Computer & Advance Hacking & Blogger & YouTuber.

Leave a Reply

Your email address will not be published. Required fields are marked *

Show Buttons
Hide Buttons