DEV Community

Arokya Naresh
Arokya Naresh

Posted on

Python tutorial (#print #printcommand #python)10.07.2024

sep operator(used to seperate word with sepearte with spcial characters like-,*)

concatenation-add two strings

escape sequence-used to print pattern

Escape sequences allow you to include special characters in strings.
To do this, simply add a backslash () before the character you want to escape.

Raw string-used to print what exactly to be printed. this helps to print systempath

In python,whatever input is given output will be a string so we need to do casting

we cannot print string and integer together
eg;
print('abc'+123)
this gives an error so we need todo typecasting

print('abc'+str(123))
o/p abc123

printing with single,double,triple quote

String Multiplication-we can multiply single word with '*'
eg;
print('hello '*5)

Format
name='ABC'
print('My name is '+name)

Top comments (0)