Write a function which returns a substring in the string 'sigma' (character given)which starts wit 'alpha' and ends with 'thita'
Answers
Answered by
0
Answered by
0
Answer:
method 1(if alpha and thita is str)
def sub(a,b,c):
l1=a.find(b)
l2=a.find(c)
return(a[l1:l2+1])
sigma=input()
alpha=input() #here alpha and theta is string
thita=input()
print(sub(sigma,alpha,thita))
method 2(if alpha and thita is int)
def sub(a,b,c):
return(a[b:c+1])
sigma=input()
alpha=int(input())
thita=int(input())
print(sub(sigma,alpha,thita))
Explanation:
Similar questions
Math,
8 months ago
Science,
8 months ago
Math,
1 year ago
Computer Science,
1 year ago
Computer Science,
1 year ago