HW2 Steps
Step 1:
Read file; line by line;
split each line into words;
for each word; add the word to a Python dictionary called
word_pos_dict
where KEY is the word; VALUE is a list of positions
print dictionary
Step 2:
use the dictionary, word_pos_dict, to recreate the song; construct a
new dictionary, called linear_dict, whose KEY will be positions
1,2,3,…. VALUE is the word that appears in that position
use linear_dict to print the song
Step 3: Print # unique words
Step 4: Print most frequent word
show databases
create database company
show databases
use company
CREATE TABLE CUSTOMERS(
ID INT NOT NULL,
NAME VARCHAR (20) NOT NULL,
AGE INT NOT NULL,
ADDRESS CHAR (25) ,
SALARY DECIMAL (18, 2),
PRIMARY KEY (ID)
);
exit;
show databases