Python programming codes
43 subscribers
25 photos
1 video
83 files
82 links
Uploading All programming codes are updating Daily
ask doubts in comment box 🎁☑️
Download Telegram
#String operations first one concatenation
string1 = "Hello"
string2 = "World"
concatenated_string = string1 + " " + string2
print(concatenated_string) # "Hello World"
#String operations second one is Replication or Repeated
string = "python" #python wtihout space
repeated_string = string * 3
print(repeated_string) # "pythonpythonpython"


string = "python " #python with space
repeated_string = string * 3
print(repeated_string) # "pythonpythonpython"
#String operations third one is Indexing

string = "Hello World!"
print(string[0]) # "H"
print(string[-1]) # "!"
print(string[7]) # "o"
print(string[-7]) # " "
print(string[5]) # " "
print(string[11]) # "!"
#String operations fourth one is slickng

#slicing is string[start:stop:end]

string = "Hello World!"
print(string[6:11]) # "World"
print(string[:5]) # "Hello"
print(string[7:]) # "World!"
print(string[6:11:1]) # "World"
print(string[:5:-2]) # "!lo"
print(string[7::2]) # "ol!"