Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

Write a Python program to accept two strings as input and check if they are identical copy of each other or if the second string is a substring of the first string.

ss='Hello w'
ms='Hello world'

if(ss==ms):
    print( 'Both the strings are same')

elif(ms.find(ss)!=-1):
    print ('{0} is a substring of {1}'.format(ss,ms))

else:
    print ('None')
Comment

PREVIOUS NEXT
Code Example
Python :: gnuplot sum over a column 
Python :: generate 50 characters long for django 
Python :: python returning rows and columns from a matrix string 
Python :: bash: line 1: templates/addtask.html: No such file or directory in flask app 
Python :: Use in in django while preserving order 
Python :: wxpython menu callback stackoverflow 
Python :: linux pyspark select java version 
Python :: The current Numpy installation fails to pass a sanity check due to a bug in the windows runtime. 
Python :: 12 hour clock to 24 hour clock in python 
Python :: how many orders has customer made database python 
Python :: pip upgrade command 
Shell :: install git on amazon linux 
Shell :: how to delete dangling docker images 
Shell :: conda install gensim 
Shell :: expo fix dependencies 
Shell :: stash untrack files 
Shell :: brew install gcloud 
Shell :: maven skip tests 
Shell :: restart redis ubuntu 
Shell :: git pull master discard local changes 
Shell :: dns flush windows 
Shell :: docker stop all 
Shell :: ubuntu install vlc 
Shell :: ping command not found docker 
Shell :: how to change hostname in ubuntu 
Shell :: how to check battery health of laptop in cmd 
Shell :: ubuntu version command 
Shell :: install nano ubuntu 
Shell :: npm install redux and react-redux 
Shell :: install protoc ubuntu 
ADD CONTENT
Topic
Content
Source link
Name
9+6 =