Churn Emails – Count Number Domain
Write a function count_message_from_domain which reads the file /cxldata/datasets/project/mbox-short.txt. This function builds a histogram using a dictionary to count how many messages have come from each domain(Instead of from email address), and returns the dictionary. If your logic is correct then your function should return below dictionary Ans:
Churn Emails – Count Number of Messages
Python Project – Churn Emails – Count Number of Messages From Each Email Address Write a function count_message_from_email which reads the file /datasets/project/mbox-short.txt. This function builds a histogram using a dictionary to count how many messages have come from each email address and returns the dictionary. Output If your logic is correct then…
Churn Email: Day of the Week
Python Project – Churn Emails – Find Which Day of the Week the Email was sent Write a function find_email_sent_days which reads the file /datasets/project/mbox-short.txt and categorizes each mail message by which day of the week the email was sent. To do this do the following: Note: You have to…
Compute the Compound Interest.py
Write a function with name compound_interest that takes three arguments: principle, rate and years in order. the rate is float and years is an integer. The function signature should look like the following. This function should return the compounded interest a float value. How to calculate compounded interest? The simple…
String Data Type
A string is a sequence of characters. String Data Type Adding and Concatenation using ‘+’ Adding to the two string using the ‘+’ Adding to the two string using the ‘+’ but even the numeric values here is also a string adding any numeric value to it will cause error….
String Library
String Replace This will replace the Bob with James and store it in the new variable. The variable ‘str’ will remain the same. Strip or lstrip Prefixes Parsing and Extracting Extracting data from an email ID required to search the letter ‘@’ then search the keyword ‘>’, then print the…
‘in’ statement in String
Python Function to confirm he vowel in the given input. The statement ‘in’ works as searching something in a string. Find ASCII Values: ord(‘A’)
awk Marking keywords
Marking keywords In the following example, we mark Java keywords in a source file. The program adds and tags around each of the keywords that it recognizes. This is a basic example; it works on keywords that are separate words. It does not address the more complicated structures. We load…
awk Rock-Paper-Scissors
Rock-Paper-Scissors Rock-paper-scissors is a popular hand game in which each player simultaneously forms one of three shapes with an outstretched hand. We create this game in AWK. We play the game against the computer, which chooses its options randomly. We seed the random number generator with the srand() function. The…