<jupyter_start><jupyter_text>Question 1Create a function that takes a number as an argument and returns True or False depending on whether the number is symmetrical or not. A number is symmetrical when it is the same as its reverse.Examplesis_symmetrical(7227) ➞ Trueis_symmetrical(12567) ➞ Falseis_symmetrical(44444444) ➞ Trueis_symmetrical(9939) ➞ Falseis_symmetrical(1112111) ➞ True<jupyter_code>def is_symmetrical(no):
    if str(no) == str(no)[::-1]:
        return True
    else:
        return False
is_symmetrical(7227)<jupyter_output><empty_output><jupyter_text>Question 2Given a string of numbers separated by a comma and space, return the product of the numbers.Examplesmultiply_nums("2, 3") ➞ 6multiply_nums("1, 2, 3, 4") ➞ 24multiply_nums("54, 75, 453, 0") ➞ 0multiply_nums("10, -2") ➞ -20<jupyter_code>def multiply_nums(s):
    s = s.replace(' ', "")
    s = s.split(',')
    sum = 1
    for i in s:
        sum = sum * int(i)
    return sum
    
multiply_nums("10, -2")<jupyter_output><empty_output><jupyter_text>Question 3Create a function that squares every digit of a number.Examplessquare_digits(9119) ➞ 811181square_digits(2483) ➞ 416649square_digits(3212) ➞ 9414NotesThe function receives an integer and must return an integer.<jupyter_code>def square_digits(n):
    z = "".join(str(int(i)*int(i)) for i in str(n))
    return z
    
square_digits(3212)<jupyter_output><empty_output><jupyter_text>Question 4Create a function that sorts a list and removes all duplicate items from it.Examplessetify([1, 3, 3, 5, 5]) ➞ [1, 3, 5]setify([4, 4, 4, 4]) ➞ [4]setify([5, 7, 8, 9, 10, 15]) ➞ [5, 7, 8, 9, 10, 15]setify([3, 3, 3, 2, 1]) ➞ [1, 2, 3]<jupyter_code>def setify(lst):
    return list(set(lst))
setify([1, 3, 3, 5, 5])<jupyter_output><empty_output><jupyter_text>Question 5Create a function that returns the mean of all digits.Examplesmean(42) ➞ 3mean(12345) ➞ 3mean(666) ➞ 6NotesThe mean of all digits is the sum of digits / how many digits there are (e.g. mean of digits in 512 is (5+1+2)/3(number of digits) = 8/3=2).The mean will always be an integer.<jupyter_code>def mean(n): 
    N = len(str(n)) 
    sum = mean = 0
    
    for digit in str(n):
        sum += int(digit)       
    return int(sum/N)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.12721631205673758, 'fraction_numerical': 0.07225177304964539, 'mean_word_length': 4.5318627450980395, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 1, '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': '548670', 'license': 'MIT', 'n_tokens_mistral': 1006, 'n_tokens_neox': 853, 'n_words': 259, 'path': 'Programming_Assingment_23.ipynb', 'repo_name': 'Shanu2092/Python-Basic-Programming-Assignment', 'size': '2256'}