Professional Documents
Culture Documents
1st Chapter 2 Marks
1st Chapter 2 Marks
int
False
Program explaining usage of multiline Escape sequences
statements using line continuation
character(\)
x="hai "+\ They are mainly used to format the display of the given
"welcome "+\ data
"to cse" Escape sequence characters
1) \' - prints single quote
print(x)
print("what\'s your age")
Output Output
hai welcome to cse what's your age
2) \"-prints double quotes
print("\"hai welcome\"")
Output
"hai welcome"
3) \n – prints newline character
print("hai\ncse")
Output
hai
cse
4)\t- prints tab
Program to display "Hello world" right justified What happens when semicolon is placed at the end
and center-aligned with a width of 20 characters of print statement
print(format("Hello world",">20")) #right justified There will be no error and output will be printed as
Hello world usual
print(format("Hello world","^20")) #center aligned-
displaying Hello world in the center Example
print "hi";
hi