Python Tutorial

Part 4: Conditional statement, for loops and first assignment consisting of 10 challenging questions

In this video, we will talk about the following topics:
</br>
1. Conditional statements
2. For loops
3. First assignment consists of 10 challenging questions related to data structures, conditional statements, and for loops

here is the link to the data and all the assignment questions.
https://archive.ics.uci.edu/ml/machin...

1. Text Data: Download the "SMS Spam Collection" dataset from the UCI Machine Learning Repository https://archive.ics.uci.edu/ml/machin... . Use this dataset as the text data for the assignment.

2. List: Create an empty list named "data_list".
Read the text data file and store each line of text as an element in the "data_list" list.
finally print the number of messages.

3. Dictionary: Create an empty dictionary named "word_counts".
Iterate over each line in the "data_list" and count the occurrences of each word.
Store the word counts in the "word_counts" dictionary.

4. Set: Create a set named "unique_words" containing all the unique words from the text data file.
Exclude any punctuation or special characters. Calculate the length of each word and include only those words
that have a length greater than 0 and do not contain any numbers.

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 and print each word along with its
frequency.

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.

#python_mini_project #for_loops #conditional_statements