<jupyter_start><jupyter_text>Programming_Assignment-24  Question1Create a function that takes an integer and returns a list from 1 to the given number, where:    1. If the number can be divided evenly by 4, amplify it by 10 (i.e. return 10 times the number).2. If the number cannot be divided evenly by 4, simply return the number.Examplesamplify(4) ➞ [1, 2, 3, 40]amplify(3) ➞ [1, 2, 3]amplify(25) ➞ [1, 2, 3, 40, 5, 6, 7, 80, 9, 10, 11, 120, 13, 14, 15, 160,               17, 18, 19, 200, 21, 22, 23, 240, 25]Notes* The given integer will always be equal to or greater than 1.* Include the number (see example above).* To perform this problem with its intended purpose, try doing it with listcomprehensions. If that's too difficult, just solve the challenge any way you can<jupyter_code>def amplify(n):
    return [i*10 if i % 4 == 0 else i for i in range(1,n+1) ]
amplify(4)
amplify(3)
amplify(25)<jupyter_output><empty_output><jupyter_text>Question2Create a function that takes a list of numbers and return the number that's unique.Examplesunique([3, 3, 3, 7, 3, 3]) ➞ 7unique([0, 0, 0.77, 0, 0]) ➞ 0.77unique([0, 1, 1, 1, 1, 1, 1, 1]) ➞ 0NotesTest cases will always have exactly one unique number while all others are the same.<jupyter_code>def unique(lst):
    s = list(set(lst))# give us unique value
    for i in s:
        if lst.count(i) == 1:
            return i
        
unique([3, 3, 3, 7, 3, 3])
unique([0, 0, 0.77, 0, 0])
unique([0, 1, 1, 1, 1, 1, 1, 1])<jupyter_output><empty_output><jupyter_text>Question3Your task is to create a Circle constructor that creates a circle with a radius provided by anargument. The circles constructed must have two getters getArea() (PIr^2) andgetPerimeter() (2PI*r) which give both respective areas and perimeter (circumference).For help with this class, I have provided you with a Rectangle constructor which you can useas a base example.Examplescircy = Circle(11)circy.getArea() Should return 380.132711084365circy = Circle(4.44)circy.getPerimeter()Should return 27.897342763877365NotesRound results up to the nearest integer.<jupyter_code>class Circle():
    def __init__(self, r):
        self.radius = r

    def getArea(self):
        return round(self.radius**2*3.14)
    
    def getPerimeter(self):
        return round(2*self.radius*3.14)
circy = Circle(11)
circy.getArea()
circy = Circle(4.44)
circy.getPerimeter()<jupyter_output><empty_output><jupyter_text>Question4Create a function that takes a list of strings and return a list, sorted from shortest to longest.Examplessort_by_length(['Google', 'Apple', 'Microsoft'])➞ ['Apple', 'Google', 'Microsoft']sort_by_length(['Leonardo', 'Michelangelo', 'Raphael', 'Donatello'])➞ ['Raphael', 'Leonardo', 'Donatello', 'Michelangelo']sort_by_length(['Turing', 'Einstein', 'Jung'])➞ ['Jung', 'Turing', 'Einstein']NotesAll test cases contain lists with strings of different lengths, so you won't have to deal withmultiple strings of the same length.<jupyter_code>def sort_by_length(lst):
    return sorted(lst, key = len)

sort_by_length(['Google', 'Apple', 'Microsoft'])

sort_by_length(['Leonardo', 'Michelangelo', 'Raphael', 'Donatello'])
sort_by_length(['Turing', 'Einstein', 'Jung'])<jupyter_output><empty_output><jupyter_text>Question5Create a function that validates whether three given integers form a Pythagorean triplet. Thesum of the squares of the two smallest integers must equal the square of the largest number tobe validated.Examplesis_triplet(3, 4, 5) ➞ True* 3² + 4² = 25* 5² = 25is_triplet(13, 5, 12) ➞ True* 5² + 12² = 169* 13² = 169is_triplet(1, 2, 3) ➞ False* 1² + 2² = 5* 3² = 9NotesNumbers may not be given in a sorted order.<jupyter_code>def is_triplet(a,b,c):
    lst = []
    lst.extend((a,b,c))
    lst = sorted(lst)

    if lst[0]**2 + lst[1]**2 == lst[2]**2:
        print('Triplets')
        return True
    else:
        print("not triplet")
        return False
is_triplet(3, 4, 5)
is_triplet(13, 5, 12)
is_triplet(1, 2, 3)<jupyter_output>not triplet
{'fraction_non_alphanumeric': 0.12415349887133183, 'fraction_numerical': 0.059443190368698266, 'mean_word_length': 4.648725212464589, 'pattern_counts': {'":': 0, '<': 20, '<?xml version=': 0, '>': 20, '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': '130362', 'license': 'Apache-2.0', 'n_tokens_mistral': 1582, 'n_tokens_neox': 1343, 'n_words': 483, 'path': 'Programming_Assignment-24.ipynb', 'repo_name': 'TiwariManis/Assinments', 'size': '3987'}