Program Discussion :: Array
4 / 23
Given an array of size MxN and coordinates of starting of subarray (x, y). You need to rotate that subarray and then print the full array after rotation.
Answer:
def first_word(str1,arr):
ch=''
for x in str1.split(" "):
if x not in arr:
ch =x.capitalize() ' '
else:
ch =x ' ';
return ch;
print(first_word("this is crazy and fun",["fun" ,"is"]))
Asked In ::
Language:

Pandey
17 Oct, 2020 6:41 PM
def first_word(str1,arr):
ch=''
for x in str1.split(" "):
if x not in arr:
ch =x.capitalize() ' '
else:
ch =x ' ';
return ch;
print(first_word("this is crazy and fun",["fun" ,"is"]))