Python Tutorial

Part 5/1: Solutions of first mini project (for loops, if statements, & data structure manipulation)

In this video, we will answer and elaborate on the first part of Python mini projects about List, Dictionaries, and Set. In these examples for loops and conditional statements will be wholly elaborated.

You will find the complete explanation regarding the question in the following link:

• Part 4: Conditional statement, for lo...

we will answer to the following questions:

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.

#python_mini_project #sms_spam_collection #python