Escape-Sequennce

Tue 09 December 2025
#  Escape Sequence in Python
#  error code for escape sequence 
print("he said 'python is fun ultimated'")
he said 'python is fun ultimated'
print('He said "Python is fun unlimited"')
He said "Python is fun unlimited"
print('He said \'Python is fun unlimited\'')
He said 'Python is fun unlimited'
print("Welcome to\tScientech Easy") # --> gives a tab between words
Welcome to  Scientech Easy
print("Good Morning \nScientech Easy")  #--> breaks one line into two lines 
Good Morning 
Scientech Easy
print("*\n**\n***\n")
*
**
***
print('Good Evening \\Scientech Easy\\') #--> prints the text with backslash
Good Evening \Scientech Easy\
print('Good Morning \rScientech Easy') # --> moves the output means it will not print the string before \r
Scientech Easy
emp_code = "IT-35264"
name = "Jerin"
desig = "Jr. Python Developer"
comp = "tact"
salary = "USD 40000"
print("Employee code: ", emp_code, "\nName: ", name)
Employee code:  IT-35264 
Name:  Jerin
print("Designation: ",desig, "\tCompany: ", comp)
Designation:  Jr. Python Developer  Company:  tact
print("Annual Salary: ", salary)
Annual Salary:  USD 40000
print("Employee code: ", emp_code, "\nName: ", name)
print("Designation: ",desig, "\tCompany: ", comp)
print("Annual Salary: ", salary)
Employee code:  IT-35264 
Name:  Jerin
Designation:  Jr. Python Developer  Company:  tact
Annual Salary:  USD 40000


Score: 20

Category: Python basics