From e9064eb8f21acc028601b9d26e74f34c9dad3fe2 Mon Sep 17 00:00:00 2001 From: ammar0211 <32436267+ammar0211@users.noreply.github.com> Date: Sun, 25 Mar 2018 16:48:16 +0530 Subject: [PATCH 1/3] Update wordValue.py --- src/wordValue.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/wordValue.py b/src/wordValue.py index 1baf5cd..27db482 100644 --- a/src/wordValue.py +++ b/src/wordValue.py @@ -2,4 +2,7 @@ #example valueDict = {'o': 3, 's': 7} word = 'os' #return 3+7 = 10 def word_value(valueDict, word): - pass + wordlist=[x for x in word if word!=' '] + sum=0 + for k in [valueDict[j] for i in wordlist for j in valueDict.keys() if i==j]: sum+=k + return sum From db0255c55eb8934457a260e5f1a74c43b899ee4a Mon Sep 17 00:00:00 2001 From: ammar0211 <32436267+ammar0211@users.noreply.github.com> Date: Sun, 25 Mar 2018 17:11:49 +0530 Subject: [PATCH 2/3] Update text_score.py --- src/text_score.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/text_score.py b/src/text_score.py index 8776f8d..bd4918c 100644 --- a/src/text_score.py +++ b/src/text_score.py @@ -10,4 +10,9 @@ # output: -1 def text_score(message, positive_word, negative_word): - pass \ No newline at end of file + message_list=message.split() + Score_Count=0 + for i in message_list: + if i==positive_word: Score_Count+=1 + elif i==negative_word: Score_Count-=1 + return Score_Count From cc6a75ebbc53d1a94f797b5355e3a4548591b13e Mon Sep 17 00:00:00 2001 From: ammar0211 <32436267+ammar0211@users.noreply.github.com> Date: Sun, 25 Mar 2018 19:23:44 +0530 Subject: [PATCH 3/3] Update alternatingLists.py --- src/alternatingLists.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/alternatingLists.py b/src/alternatingLists.py index 0593ecc..be16272 100644 --- a/src/alternatingLists.py +++ b/src/alternatingLists.py @@ -3,4 +3,14 @@ #ex: ['a','b','c','d'], ['1','2'] #return: ['a','1','b','2','c','d'] def alternating_lists(list1, list2): - pass + Alt_list=[] + if len(list1)>len(list2): + for i in range(len(list1)): + if i