<jupyter_start><jupyter_text>PRACTICE PROBLEMS ON FUNCTION**[MUST MAINTAIN VARIABLE NAMING CONVENTIONS FOR ALL THE TASKS]****[Solve all the tasks sequentially]**  Task 1Write a function called **check_awesomeness** that takes a number as an argument and Checks whether the number is Awesome or not. If the number is Awesome, it returns True. Otherwise False. **Awesome number:** a number where every digit is less than its immediate left digit is called an Awesome number. A single digit number cannot be a awesome number(e.g. 5421 is an Awesome number).==========================================================**Function Call1:**\check_awesomeness(976321)\**Output1:**\True==========================================================**Function Call2:**\check_awesomeness(9766321)\**Output2:**\False==========================================================**Function Call3:**\check_awesomeness(9)\**Output3:**\False==========================================================**Function Call4:**\check_awesomeness(78)\**Output4:**\False==========================================================**Function Call5:**\check_awesomeness(87)\**Output4:**\True<jupyter_code>#todo<jupyter_output><empty_output><jupyter_text>Task 2Write a function called **check_awesome** that takes a list of numbers(integer) as an argument and Prints whether the number is Awesome or not.**Must reuse the check_awesomeness() function.**==========================================================**Function Call1:**\check_awesome([976321, 321, 9763221, 9742, 876, 3211])\**Output1:**\976321 is an awesome number.\321 is a awesome number.\9763221 is a not-so-awesome number.\9742 is an awesome number.\876 is an awesome number.\3211 is a not-so-awesome number.==========================================================**Function Call2:**\check_awesome([97821, 97210, 979210])\**Output2:**\97821 is a not-so-awesome number.\97210 is an awesome number.\979210 is a not-so-awesome number.<jupyter_code>#todo<jupyter_output><empty_output><jupyter_text>Task 3Write a function called **find_max_min** that takes a list of numbers(integers) as a  function parameter and finds the numbers with maximum and minimum value. Then returns these two numbers as a **tuple** and prints the results using tuple unpacking in the function call accorrding to the given format. Both valid and invalid numbers should be considered for finding maximum and minimum.[Must use tuple packing & unpacking]  ==========================================================**Function Call1:**\find_max_min([976321, 321, 9763221, 9742, 876, 3211, 976321, 9742])\**Output1:**\Returned value from find_max_min() is: (9763221, 321)\Number with maximum value is 9763221\Number with minimum value is 321==========================================================**Function Call2:**\find_max_min([97821, 1, 97210, 963, 979210, 979210])\**Output2:**\Returned value from find_max_min() is: (979210, 1)\Number with maximum value is 979210\Number with minimum value is 1<jupyter_code>#todo<jupyter_output><empty_output><jupyter_text>Task 4Write a function called **data_cleaning** that takes a string as an argument. Then gets the numbers from the given string and removes all extra spaces. Stores the clean numbers (integers) in a list and **returns** it to the function call.==========================================================**Function Call1:**\data_cleaning("97821, 1 &nbsp;&nbsp;&nbsp;  , 97210,&nbsp;&nbsp; 963, &nbsp;&nbsp;&nbsp;979210 , 979210   ")\**Output1:**\Data after cleaning: [97821, 1, 97210, 963, 979210, 979210]==========================================================**Function Call2:**\data_cleaning("976321, 321&nbsp;&nbsp;,&nbsp;&nbsp;&nbsp;9763221, &nbsp;&nbsp;&nbsp;9742, 876,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 3211")\**Output2:**\Data after cleaning: [976321, 321, 9763221, 9742, 876, 3211]==========================================================**Function Call3:**\data_cleaning("976321, 321 ,&nbsp;&nbsp;&nbsp; 9763221, 9742, &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;876, &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;3211, 976321&nbsp;&nbsp;&nbsp;&nbsp;, 9742")\**Output3:**\Data after cleaning: [976321, 321, 9763221, 9742, 876, 3211, 976321, 9742]<jupyter_code>#todo<jupyter_output><empty_output><jupyter_text>Task 5Write a function called **grouping_data** that takes  a list of numbers(integers) as a  function parameter and creates a dictionary where "valid", "invalid", and "duplicate" are the keys. The numbers that falls in those categories are the values.**Valid & Invalid numbers:** A number with a minimum length of 4 and a maximum length of 6 is considered to be valid for this assignment. All the other numbers are considered to be Invalid numbers.\**Duplicate numbers:** If a number appears more than once in the string, then that is a dupliacte number. Both valid and invalid numbers can be duplicates.Lastly, print the dictionary **inside the function** and **return** the dictionary to the function call.==========================================================**Function Call1:**\grouping_data([97821, 1, 97210, 963, 979210, 979210])\**Output1:**\XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\Data dictionary printing inside the function:\{'valid': [97821, 97210, 979210], 'invalid': [1, 963], 'duplicate': [979210]}\XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\Returned dictionary: {'valid': [97821, 97210, 979210], 'invalid': [1, 963], 'duplicate': [979210]}\Valid number list obtained from the dictionary: [97821, 97210, 979210]==========================================================**Function Call2:**\grouping_data([976321, 321, 9763221, 9742, 876, 3211])\**Output2:**\XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\Data dictionary printing inside the function:\{'valid': [976321, 9742, 3211], 'invalid': [321, 9763221, 876], 'duplicate': []}\XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\Returned dictionary: {'valid': [976321, 9742, 3211], 'invalid': [321, 9763221, 876], 'duplicate': []}\Valid number list obtained from the dictionary: [976321, 9742, 3211]==========================================================**Function Call3:**\grouping_data([976321, 321, 9763221, 9742, 876, 3211, 976321, 9742])\**Output3:**\XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\Data dictionary printing inside the function:\{'valid': [976321, 9742, 3211], 'invalid': [321, 9763221, 876], 'duplicate': [976321, 9742]}\XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\Returned dictionary: {'valid': [976321, 9742, 3211], 'invalid': [321, 9763221, 876], 'duplicate': [976321, 9742]}\Valid number list obtained from the dictionary: [976321, 9742, 3211]<jupyter_code>#todo<jupyter_output><empty_output><jupyter_text>Task6Write a function called **individual_line_data** that takes a string as an argument. This function should do the following. * clean and prints the data.* group the numbers in a dictionary obtained from the given string.* check whether the **valid numbers** are awesome or not.* find and print the maximum and minimum number among the **valid numbers** obtained from the given string.*Hints:*\You MUST reuse data_cleaning(), grouping_data(), check_awesome() and find_max_min() functions. ==========================================================**Function Call1:**\individual_line_data("97821, 1 &nbsp;&nbsp;&nbsp;  , 97210,&nbsp;&nbsp; 963, &nbsp;&nbsp;&nbsp;979210 , 979210   ")\**Output1:**\Data after cleaning: [97821, 1, 97210, 963, 979210, 979210]\XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\Data dictionary printing inside the function:\{'valid': [97821, 97210, 979210], 'invalid': [1, 963], 'duplicate': [979210]}\XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\Returned dictionary: {'valid': [97821, 97210, 979210], 'invalid': [1, 963], 'duplicate': [979210]}\Valid number list obtained from the dictionary: [97821, 97210, 979210]\=================================================\^_^ Awesomeness checking of the Valid numbers ^_^\97821 is a not-so-awesome number.\97210 is an awesome number.\979210 is a not-so-awesome number.\=================================================\Returned value from find_max_min() is: (979210, 97210)\Valid number with maximum value is 979210\Valid number with minimum value is 97210**Function Call2:**\individual_line_data("976321, 321&nbsp;&nbsp;,&nbsp;&nbsp;&nbsp;9763221, &nbsp;&nbsp;&nbsp;9742, 876,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 3211")\**Output2:**\Data after cleaning: [976321, 321, 9763221, 9742, 876, 3211]\XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\Data dictionary printing inside the function:\{'valid': [976321, 9742, 3211], 'invalid': [321, 9763221, 876], 'duplicate': []}\XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\Returned dictionary: {'valid': [976321, 9742, 3211], 'invalid': [321, 9763221, 876], 'duplicate': []}\Valid number list obtained from the dictionary: [976321, 9742, 3211]\=================================================\^_^ Awesomeness checking of the Valid numbers ^_^\976321 is an awesome number.\9742 is an awesome number.\3211 is a not-so-awesome number.\=================================================\Returned value from find_max_min() is: (976321, 3211)\Valid number with maximum value is 976321\Valid number with minimum value is 3211**Function Call3:**\individual_line_data("976321, 321 ,&nbsp;&nbsp;&nbsp; 9763221, 9742, &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;876, &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;3211, 976321&nbsp;&nbsp;&nbsp;&nbsp;, 9742")\**Output3:**\Data after cleaning: [976321, 321, 9763221, 9742, 876, 3211, 976321, 9742]\XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\Data dictionary printing inside the function:\{'valid': [976321, 9742, 3211], 'invalid': [321, 9763221, 876], 'duplicate': [976321, 9742]}\XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\Returned dictionary: {'valid': [976321, 9742, 3211], 'invalid': [321, 9763221, 876], 'duplicate': [976321, 9742]}\Valid number list obtained from the dictionary: [976321, 9742, 3211]\=================================================\^_^ Awesomeness checking of the Valid numbers ^_^\976321 is an awesome number.\9742 is an awesome number.\3211 is a not-so-awesome number.\=================================================\Returned value from find_max_min() is: (976321, 3211)\Valid number with maximum value is 976321\Valid number with minimum value is 3211<jupyter_code>#todo<jupyter_output><empty_output><jupyter_text>Task 7Write a function called **number_analysis** that takes a list of strings as an argument and analyse those strings. \**Must reuse the individual_line_data() function.**<jupyter_code>#todo<jupyter_output><empty_output><jupyter_text>Task 8Run the following block of code for seeing the final output of this Problem.**Output:** Printing data for line no: 01 \Data after cleaning: [321, 976322]\XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\Data dictionary printing inside the function:\{'valid': [976322], 'invalid': [321], 'duplicate': []}\XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\Returned dictionary: {'valid': [976322], 'invalid': [321], 'duplicate': []}\Valid number list obtained from the dictionary: [976322]\=================================================\^_^ Awesomeness checking of the Valid numbers ^_^\976322 is a not-so-awesome number.\=================================================\Returned value from find_max_min() is: (976322, 976322)\Valid number with maximum value is 976322\Valid number with minimum value is 976322&emsp;  Printing data for line no: 02 \Data after cleaning: [97821, 1, 97210, 963, 979210, 979210]\XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\Data dictionary printing inside the function:\{'valid': [97821, 97210, 979210], 'invalid': [1, 963], 'duplicate': [979210]}\XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\Returned dictionary: {'valid': [97821, 97210, 979210], 'invalid': [1, 963], 'duplicate': [979210]}\Valid number list obtained from the dictionary: [97821, 97210, 979210]\=================================================\^_^ Awesomeness checking of the Valid numbers ^_^\97821 is a not-so-awesome number.\97210 is an awesome number.\979210 is a not-so-awesome number.\=================================================\Returned value from find_max_min() is: (979210, 97210)\Valid number with maximum value is 979210\Valid number with minimum value is 97210&emsp;  Printing data for line no: 03 \Data after cleaning: [976321, 321, 9763221, 9742, 876, 3211]\XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\Data dictionary printing inside the function:\{'valid': [976321, 9742, 3211], 'invalid': [321, 9763221, 876], 'duplicate': []}\XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\Returned dictionary: {'valid': [976321, 9742, 3211], 'invalid': [321, 9763221, 876], 'duplicate': []}\Valid number list obtained from the dictionary: [976321, 9742, 3211]\=================================================\^_^ Awesomeness checking of the Valid numbers ^_^\976321 is an awesome number.\9742 is an awesome number.\3211 is a not-so-awesome number.\=================================================\Returned value from find_max_min() is: (976321, 3211)\Valid number with maximum value is 976321\Valid number with minimum value is 3211&emsp; Printing data for line no: 04 \Data after cleaning: [976321, 321, 9763221, 9742, 876, 3211, 976321, 9742]\XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\Data dictionary printing inside the function:\{'valid': [976321, 9742, 3211], 'invalid': [321, 9763221, 876], 'duplicate': [976321, 9742]}\XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\Returned dictionary: {'valid': [976321, 9742, 3211], 'invalid': [321, 9763221, 876], 'duplicate': [976321, 9742]}\Valid number list obtained from the dictionary: [976321, 9742, 3211]\=================================================\^_^ Awesomeness checking of the Valid numbers ^_^\976321 is an awesome number.\9742 is an awesome number.\3211 is a not-so-awesome number.\=================================================\Returned value from find_max_min() is: (976321, 3211)\Valid number with maximum value is 976321\Valid number with minimum value is 3211<jupyter_code>lines_of_data = [
    "321 ,   976322",
    "97821, 1 , 97210, 963, 979210 , 979210",
    "976321, 321 ,   9763221, 9742, 876, 3211",
    "976321, 321 ,   9763221, 9742, 876, 3211, 976321, 9742"
]

number_analysis(lines_of_data)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.2240070489358818, 'fraction_numerical': 0.12505083367222447, 'mean_word_length': 8.052147239263803, 'pattern_counts': {'":': 0, '<': 33, '<?xml version=': 0, '>': 33, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 20, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '8', 'dir': 'jupyter-structured-clean-dedup', 'id': '364665', 'license': 'MIT', 'n_tokens_mistral': 5483, 'n_tokens_neox': 4226, 'n_words': 1304, 'path': 'PRACTICE_Function_v3_QUES.ipynb', 'repo_name': 'ikramulkayes/CSE110-practice', 'size': '14754'}