<jupyter_start><jupyter_text>Programming_Assignment-20 Question1Create a function that takes a list of strings and integers, and filters out the list so that itreturns a list of integers only.Examplesfilter_list([1, 2, 3, 'a', 'b', 4]) ➞ [1, 2, 3, 4]filter_list(['A', 0, 'Edabit', 1729, 'Python', '1729']) ➞ [0, 1729]filter_list(['Nothing', 'here']) ➞ []<jupyter_code>def filter_list(lst):
    intLst = []
    for i in lst:
        if type(i) == int:
            intLst.append(i)
    return intLst
filter_list([1, 2, 3, 'a', 'b', 4])
filter_list(['A', 0, 'Edabit', 1729, 'Python', '1729'])
filter_list(['Nothing', 'here'])<jupyter_output><empty_output><jupyter_text>Question2Given a list of numbers, create a function which returns the list but with each element'sindex in the list added to itself. This means you add 0 to the number at index 0, add 1 to thenumber at index 1, etc...Examplesadd_indexes([0, 0, 0, 0, 0]) ➞ [0, 1, 2, 3, 4]add_indexes([1, 2, 3, 4, 5]) ➞ [1, 3, 5, 7, 9]add_indexes([5, 4, 3, 2, 1]) ➞ [5, 5, 5, 5, 5]<jupyter_code>def add_indexes(lst):
    ind = 0
    index = []
    for i in lst:
        index.append(lst.index(i,ind) + i)
        ind+=1
    return index
add_indexes([0, 0, 0, 0, 0])
add_indexes([1, 2, 3, 4, 5])
add_indexes([5, 4, 3, 2, 1])<jupyter_output><empty_output><jupyter_text>Question3Create a function that takes the height and radius of a cone as arguments and returns thevolume of the cone rounded to the nearest hundredth. See the resources tab for the formula.Examplescone_volume(3, 2) ➞ 12.57cone_volume(15, 6) ➞ 565.49cone_volume(18, 0) ➞ 0<jupyter_code>import math

pi = math.pi
 
# Function to calculate Volume of Cone
def cone_volume(r, h):
    
    return round((1 / 3) * pi * r * r * h)

r = 5 
h = 12

print( "Volume Of Cone : ", cone_volume(r, h) )

cone_volume(5, 12)
cone_volume(15, 6)
cone_volume(18,0)<jupyter_output><empty_output><jupyter_text>Question4This Triangular Number Sequence is generated from a pattern of dots that form a triangle.The first 5 numbers of the sequence, or dots, are:    1, 3, 6, 10, 15This means that the first triangle has just one dot, the second one has three dots, the third onehas 6 dots and so on.Write a function that gives the number of dots with its corresponding triangle number of thesequence.Examplestriangle(1) ➞ 1triangle(6) ➞ 21triangle(215) ➞ 23220A RuleWe can make a "Rule" so we can calculate any triangular number.First, rearrange the dots like this:triangular numbers 1 to 5Then double the number of dots, and form them into a rectangle:triangular numbers when doubled become n by n+1 rectanglesNow it is easy to work out how many dots: just multiply n by n+1Dots in rectangle = n(n+1)But remember we doubled the number of dots, soDots in triangle = n(n+1)/2We can use xn to mean "dots in triangle n", so we get the rule:Rule: xn = n(n+1)/2<jupyter_code>def triangle(n):
    return n*(n+1)*0.5

n = int(input('Please Enter the trinalge number :'))
print("The {}th triangle has {} dots ".format(n,int(triangle(n))))
triangle(1)
triangle(60)<jupyter_output><empty_output><jupyter_text>Question5Create a function that takes a list of numbers between 1 and 10 (excluding one number) andreturns the missing number.Examplesmissing_num([1, 2, 3, 4, 6, 7, 8, 9, 10]) ➞ 5missing_num([7, 2, 3, 6, 5, 9, 1, 4, 8]) ➞ 10missing_num([10, 5, 1, 2, 4, 6, 8, 3, 9]) ➞ 7<jupyter_code>def missing_num(lst):
    total = sum([x for x in range(11)])
    sum_Of_list = sum(lst)
    return total - sum_Of_list

#print(missing_num([1, 2, 3, 4, 6, 7, 8, 9, 10]))
missing_num([1, 2, 3, 4, 6, 7, 8, 9, 10])
missing_num([10, 5, 1, 2, 4, 6, 8, 3, 9])
missing_num([7, 2, 3, 6, 5, 9, 1, 4, 8])<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.1334235453315291, 'fraction_numerical': 0.06468200270635995, 'mean_word_length': 4.532934131736527, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '5', 'dir': 'jupyter-structured-clean-dedup', 'id': '11145', 'license': 'Apache-2.0', 'n_tokens_mistral': 1582, 'n_tokens_neox': 1346, 'n_words': 514, 'path': 'Programming_Assignment-20.ipynb', 'repo_name': 'TiwariManis/Assinments', 'size': '3695'}