#Slicing in String
print("SI = Starting index; EI = Ending index")
nrStr = "I am Narendra Rajpoot."
print("Length of Streing : ",len(nrStr))
print("String : ",nrStr)
print("Charcter at index 3 : ",nrStr[3])
print("String [SI = 3; EI = end of the sting] : ",nrStr[3:])
print("String [SI = 3; EI = 13] : ",nrStr[3:13])
print("String [SI = 0; EI = 10] ",nrStr[:10])
print("String [SI = 3; EI = 12; charcter differnce = 2]",nrStr[3:12:2])
input("\n\nPress Enter to exit.")
If you have a great ability of thinking, imagination and visualisation than you have to codes your thinking and visualisation.
Tuesday, 29 May 2018
To demonstrate use of slicing in string using python programming.
Subscribe to:
Post Comments (Atom)
Featured post
WAP to print of digits of a entered number.
// WAP to print of digits of a entered number #include <iostream> #include<cstdlib> using namespace std; int main() { ...

Popular Posts
-
# To implement Queue using list queueList = [] def enQueue(ele='\0'): if ele!='\0': queueList.append(...
-
# Python Program To demonstrate inheritance. # Parent Class class parentCls: def __init__(self): print("Parent Cl...
-
#Python program to demonstrate constructors # declaration of class class myClass: def __init__(self,fName,lName): # Constructor...
No comments:
Post a Comment