Escape Sequences in Python :-
Escape Sequence ऐसे विशेष Character Combinations होते हैं जो Backslash (\) से शुरू होते हैं। इनका उपयोग String के अंदर विशेष कार्य (Special Operations) करने के लिए किया जाता है, जैसे नई पंक्ति (New Line), Tab Space, Quotes प्रिंट करना आदि।
English:
An Escape Sequence is a special character combination that begins with a Backslash (\). It is used to perform special operations inside a string, such as inserting a new line, tab space, quotes, and more.
Common Escape Sequences -

Example 1: New Line (\n) -
Output -
Output -
Example 3: Backslash (\\) -
Output -
Example 4: Single Quote (\') -
Output -
Example 5: Double Quote (\") -
Output -
Example 6: Backspace (\b) -
Output -
Example 7: Carriage Return (\r)
Output -
Note: \r Cursor को लाइन की शुरुआत में ले जाता है और बाद के Characters पहले वाले Characters को Replace कर देते हैं। अलग-अलग Console में Output थोड़ा भिन्न हो सकता है।
Example 8: Form Feed (\f)
Output -
Example 9: Vertical Tab (\v)
Output -
Note: \v का प्रभाव विभिन्न Operating Systems और Terminals में अलग-अलग हो सकता है।
Example 10: Alert (\a) -
Output -
Important Points
सभी Escape Sequences Backslash (\) से शुरू होते हैं।
इनका उपयोग String के अंदर विशेष Characters या Formatting के लिए किया जाता है।
\n और \t सबसे अधिक उपयोग किए जाने वाले Escape Sequences हैं।
Quotes (' और ") तथा Backslash (\) को Print करने के लिए भी Escape Sequences का उपयोग किया जाता है.