1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
| #this program you have to create one file called properties file in that you have to define a and b variable
#need to import those variable in this program by using from <properties file> import <varible>
import properties
from properties import str1
from properties import str2
newStr = str1 + str2
newRama = str2*3
firstIndex = str2[0]
last2ndIndex = str2[-1]
newstring3 = str2[1:4]
lengthStr = len(str2)
comp = str1 < str2
find = "e" in str1
strUpper = str2.upper()
strLower = str2.lower()
print 'The concatinated String',str1,'+',str2,'is:',newStr
print 'Multiple of ',str2,'is:',newRama
print 'First index of ',str2,'is :',firstIndex
print 'Last 2nd index of ',str2,'is:',last2ndIndex
print '1st Inddex to 2nd Index of ',str2,'is:',newstring3
print 'Lenth of the string',str2,'is:',lengthStr
if find:
print 'The \'e\' is prasent in the',str1,'is found'
else :
print 'The \'e\' is prasent in the',str1,'is not found'
if comp:
print str1,'is less then',str2
else:
print str1, 'is not less then',str2
print 'Upper case of ',str2,'is:',strUpper
print 'Lowere case of ',str2,'is :',strLower
|