In this video, we will answer and elaborate on the first part of Python mini projects about Tuples, Dictionaries, Sets, Lists, for loops, conditional statements, and data structure manipulation
You will find the complete explanation regarding the question in the following link:
• Part 4: Conditional statement, for lo...
here is the link to the first part of the solutions
• Part 5/1: Solutions of first mini pro...
here are the question that we want to solve them together
5. Tuple: Create a tuple named "most_common_words" that contains the top 5 most frequently occurring words along with their frequencies from the "word_counts" dictionary. Print each word and its frequency on a separate line, along with an order number.
6. For Loop: Write a for loop to iterate over the "most_common_words" tuple. For each word, calculate the sum of the ASCII values of its characters and print only the word, the calculated sum, and the percentage of the sum relative to the total sum of all words.
7. If Statement: Write an if statement to check if a specific word exists in the "unique_words" set. If it does, print "Word found"; otherwise, print "Word not found".
8. List Manipulation: Remove all the empty strings from the "data_list".
9. Dictionary Manipulation: Create a new dictionary named "word_info" that maps each word in the "unique_words" set to a dictionary containing its length, frequency (obtained from the "word_counts" dictionary), and a list of characters in reverse order. Print the "word_info" dictionary.
10. Set Manipulation: Remove a specific word from the "unique_words" set.