<jupyter_start><jupyter_text>Assignment Day 5<jupyter_code># Question 1

# Write a program to identify sub list[1,1,5] is there in the given list is in the same order, if yes print "it's a Match", if no then print "it's Gone" in function.
#Example - Listy=[1,5,6,4,1,2,3,5]-it's a Match
           #Listy=[1,5,6,5,1,2,3,6]-it's Gone
lst1 = [1,5,6,4,1,2,3,5]
lst2 = [1,5,6,5,1,2,3,6]

lst = [1,1,5]
count = 0
r=0
for x in lst:
    for y in lst1[r:]:
        r+=1
        if (x==y):
            count+=1
            break;
        else:
            pass
        

if(count==3):
    print("it’s a Match")
else:
    print("it’s Gone")
count = 0
r=0
for x in lst:
    for y in lst2[r:]:
        r+=1
        if (x==y):
            count+=1
            break;
        else:
            pass
        

if(count==3):
    print("it’s a Match")
else:
    print("it’s Gone")
# Question 2

# Make a function for prime numbers and use Filter to filter out all the prime numbers fcheck = 0

print("Prime numbers from 1-2500 :\n")
fcheck = 0
def isPrime(num):
        for i in range(2, num):
                if num%i == 0:
                    break
                else:  
                    return num
fcheck = filter(isPrime,range(1, 2500))

print(list(fcheck))



# Question 3

# Make a Lambda function for capitalizing the whole sentence passed using arguments and map all the sentences in the List, with the lambda functions

#["hey this is sai","I am in mumbai,..."]
#o/p - ["Hey This is Sai","I Am In Mumbai,..."]
arr = []

st = ["hey this is sai,I am in mumbai"]
for x in st:
    arr = list(map(lambda x: x[::-1], x.title()))
print(list(arr))<jupyter_output>['H', 'e', 'y', ' ', 'T', 'h', 'i', 's', ' ', 'I', 's', ' ', 'S', 'a', 'i', ',', 'I', ' ', 'A', 'm', ' ', 'I', 'n', ' ', 'M', 'u', 'm', 'b', 'a', 'i']
{'fraction_non_alphanumeric': 0.18146503884572698, 'fraction_numerical': 0.039400665926748055, 'mean_word_length': 2.296160877513711, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 3, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '647463', 'license': 'Apache-2.0', 'n_tokens_mistral': 731, 'n_tokens_neox': 693, 'n_words': 226, 'path': 'Day5_AssignmentPython.ipynb', 'repo_name': 'Ashmitha-Pasanna/LetsUpgrade-Python-assignment', 'size': '1802'}