<jupyter_start><jupyter_text>Question 1:<jupyter_code>Create a function that takes a list of strings and integers, and filters out the list so that it
returns a list of integers only.
Examples
filter_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_output><empty_output><jupyter_text>Answer :<jupyter_code>def filter_list(lst):
    return [i for i in lst if type(i) == int]

print(filter_list([1, 2, 3, "a", "b", 4]))
print(filter_list(["A", 0, "Edabit", 1729, "Python", "1729"]))
print(filter_list(["Nothing", "here"]))<jupyter_output>[1, 2, 3, 4]
[0, 1729]
[]<jupyter_text>Question 2:<jupyter_code>Given a list of numbers, create a function which returns the list but with each element's
index in the list added to itself. This means you add 0 to the number at index 0, add 1 to the
number at index 1, etc...
Examples
add_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_output><empty_output><jupyter_text>Answer:<jupyter_code>def add_indexes(lst):
    return [i+j for i,j in zip(lst,range(0,len(lst)))]

print(add_indexes([0, 0, 0, 0, 0]))
print(add_indexes([1, 2, 3, 4, 5]))
print(add_indexes([5, 4, 3, 2, 1]))<jupyter_output>[0, 1, 2, 3, 4]
[1, 3, 5, 7, 9]
[5, 5, 5, 5, 5]<jupyter_text>Question 3:<jupyter_code>Create a function that takes the height and radius of a cone as arguments and returns the
volume of the cone rounded to the nearest hundredth. See the resources tab for the formula.
Examples
cone_volume(3, 2) ➞ 12.57
cone_volume(15, 6) ➞ 565.49
cone_volume(18, 0) ➞ 0<jupyter_output><empty_output><jupyter_text>Answer :<jupyter_code>from math import pi

def cone_volume(h,r):
    return round(pi*r*r*h/3,2)

print(cone_volume(3, 2))
print(cone_volume(15, 6))
print(cone_volume(18, 0))<jupyter_output>12.57
565.49
0.0<jupyter_text>Question 4:<jupyter_code>This 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, 15
This means that the first triangle has just one dot, the second one has three dots, the third one
has 6 dots and so on.
Write a function that gives the number of dots with its corresponding triangle number of the
sequence.
Examples
triangle(1) ➞ 1
triangle(6) ➞ 21
triangle(215) ➞ 23220<jupyter_output><empty_output><jupyter_text>def triangle(n):    nt = 0    for i in range(0,n):        nt += 1+i    return ntprint(triangle(1))print(triangle(6))print(triangle(215))<jupyter_code>Question 5:<jupyter_output><empty_output><jupyter_text>Create 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):
    test = list(range(1,11))
    for i in test:
        if i in lst:
            continue
        else:
            return i
    return "This list contains all numbers from1 to 10."

print(missing_num([1, 2, 3, 4, 6, 7, 8, 9, 10]))
print(missing_num([7, 2, 3, 6, 5, 9, 1, 4, 8]))
print(missing_num([10, 5, 1, 2, 4, 6, 8, 3, 9]))<jupyter_output>5
10
7
{'fraction_non_alphanumeric': 0.1496680748340374, 'fraction_numerical': 0.07785153892576946, 'mean_word_length': 4.919642857142857, 'pattern_counts': {'":': 0, '<': 33, '<?xml version=': 0, '>': 33, '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': '9', 'dir': 'jupyter-structured-clean-dedup', 'id': '95194', 'license': 'MIT', 'n_tokens_mistral': 1556, 'n_tokens_neox': 1306, 'n_words': 453, 'path': 'Python Programming Basic Assignment/Assignment_20.ipynb', 'repo_name': 'kpsanjeet/Python-Programming-Basic-Assignment', 'size': '3314'}