Professional Documents
Culture Documents
Python Learning
Python Learning
1. Comments
2. escape character
3. Variables and Datatypes
4. Typecasting
5. String Slicing and String methods or functions
## Comments :
## Escape character :
## Variables, Datatypes :
## Typecasting :
1. var1 = "Hello World"; print(var1[4]) --> will print 4 letter of string (Only
"O")
2. print(var1[0:4]) --> print Hell
3. print(var1[0:4:2]) --> will print Hl (Skips character
sequence)
4. print(var1[0:]) --> it means [0:n] will print full string
5. print(var1[:5]) --> print from 0 to 4
6. print(var[0::2]) --> will print 0 character upto n with
skip sequence of 1 character
7. print(var[::]) --> it means [0:n:1] will print full
string