From b6b639202360f75ac58ac37e4eccc9a48e5e0f3c Mon Sep 17 00:00:00 2001 From: rayk472 <102784710+rayk472@users.noreply.github.com> Date: Tue, 26 Jul 2022 17:31:43 -0700 Subject: [PATCH 01/11] Deleted average numbers --- code/kelin/Average-numbers.py | 26 +++++++++++ code/kelin/lab04_blackjack_advice.py | 70 ++++++++++++++++++++++++++++ 2 files changed, 96 insertions(+) create mode 100644 code/kelin/Average-numbers.py create mode 100644 code/kelin/lab04_blackjack_advice.py diff --git a/code/kelin/Average-numbers.py b/code/kelin/Average-numbers.py new file mode 100644 index 00000000..aebc215b --- /dev/null +++ b/code/kelin/Average-numbers.py @@ -0,0 +1,26 @@ +# kelin-lab00-average-numbers + + + + +nums = [5, 0, 8, 3, 4, 1, 6] +x = sum(nums) +i = len(nums) +answer = (x / i) +print(answer) + +# Prints Answer 3.857142857142857 Average of 5, 0, 8, 3, 4, 1, and 6 + +# Version 2 + +user_nums = [] + +while True: + user = input("Enter numbers to average, and type 'done' to calculate: ") + if user == "done": + print((sum(user_nums)) / (len(user_nums))) + else: + user_nums.append(int(user)) + print(user_nums) + +# User enters number and displays them in a list until they type 'done' and the average is given. \ No newline at end of file diff --git a/code/kelin/lab04_blackjack_advice.py b/code/kelin/lab04_blackjack_advice.py new file mode 100644 index 00000000..eb68c932 --- /dev/null +++ b/code/kelin/lab04_blackjack_advice.py @@ -0,0 +1,70 @@ +# Lab 4: Blackjack Advice + +# Let's write a python program to give basic blackjack playing advice during a game by asking the player for cards. +# First, ask the user for three playing cards (A, 2, 3, 4, 5, 6, 7, 8, 9, 10, J, Q, or K). +# Then, figure out the point value of each card individually. Number cards are worth their number, all face cards are worth 10. +# At this point, assume aces are worth 1. Use the following rules to determine the advice: + +deck_one = ['A','2','3','4','5','6','7','8','9','10','J','Q','K','A','2','3','4','5','6','7','8','9','10','J','Q','K','A','2','3','4','5','6','7','8','9','10','J','Q','K','A','2','3','4','5','6','7','8','9','10','J','Q','K'] +deck_two = ['A','2','3','4','5','6','7','8','9','10','J','Q','K','A','2','3','4','5','6','7','8','9','10','J','Q','K','A','2','3','4','5','6','7','8','9','10','J','Q','K','A','2','3','4','5','6','7','8','9','10','J','Q','K'] +deck_three = ['A','2','3','4','5','6','7','8','9','10','J','Q','K','A','2','3','4','5','6','7','8','9','10','J','Q','K','A','2','3','4','5','6','7','8','9','10','J','Q','K','A','2','3','4','5','6','7','8','9','10','J','Q','K'] + +import random + +random.shuffle(deck_one) +random.shuffle(deck_two) +random.shuffle(deck_three) + +first_card = random.choice(deck_one) +second_card = random.choice(deck_two) +third_card = random.choice(deck_three) + +print(f"Welcome to Blackjack.","Your cards are:",first_card,second_card,third_card) + +if first_card == 'A': + first_card = int('1') +elif first_card == 'J': + first_card = int('10') +elif first_card == 'Q': + first_card = int('10') +elif first_card == 'K': + first_card = int('10') + +if second_card == 'A': + second_card = int('1') +elif second_card == 'J': + second_card = int('10') +elif second_card == 'Q': + second_card = int('10') +elif second_card == 'K': + second_card = int('10') + +if third_card == 'A': + third_card = int('1') +elif third_card == 'J': + third_card = int('10') +elif third_card == 'Q': + third_card = int('10') +elif third_card == 'K': + third_card = int('10') + +first_card = (int(first_card)) +second_card = (int(second_card)) +third_card = (int(third_card)) + +card_totals = (first_card + second_card + third_card) + +if card_totals < 17: + print("You should hit.") +elif card_totals in range (17, 21): + print("You should stay.") +elif card_totals > 21: + print("Sorry you busted.") +elif card_totals > 20: + print("Congratulations, Blackjack!") + +# Version 2 (optional) + +# Aces can be worth 11 if they won't put the total point value of both cards over 21. Remember that you can have multiple aces in a hand. +# Try generating a list of all possible hand values by doubling the number of values in the output whenever you encounter an ace. +# For one half, add 1, for the other, add 11. This ensures if you have multiple aces that you account for the full range of possible values. From 200289ae4ac9c1229225e07f948f496727e7c0f7 Mon Sep 17 00:00:00 2001 From: rayk472 <102784710+rayk472@users.noreply.github.com> Date: Wed, 27 Jul 2022 22:13:22 -0700 Subject: [PATCH 02/11] Working on mini capstone --- code/kelin/labs/mini_capstone.py | 83 ++++++++++++++++++++++++++++++++ 1 file changed, 83 insertions(+) create mode 100644 code/kelin/labs/mini_capstone.py diff --git a/code/kelin/labs/mini_capstone.py b/code/kelin/labs/mini_capstone.py new file mode 100644 index 00000000..c364b97d --- /dev/null +++ b/code/kelin/labs/mini_capstone.py @@ -0,0 +1,83 @@ +import emoji + +# https://pypi.org/project/emoji/ emoji 2.0.0 +# pip install emoji +# emoji list https://carpedm20.github.io/emoji/ + +# Using emoji package to help describe my understanding of Python lessons: +# Fundamentals +# Exceptions + Testing +# Numbers + Arithmetic +# Booleans + Comparisons + Conditionals +# Imports + Modules + Packages +# Random +# While + For Loops +# Strings +# Lists + Tuples +# Functions +# Dictionaries +# Regular Expressions in Python +# Datetimes +# Classes +# Requests +# Docstrings +# File IO +# Sets +# Virtual Environments + +print(emoji.emojize(f'Learning Python is :downcast_face_with_sweat: sometimes, and it can even make my head :exploding_head: !!!')) + +# emojize takes the code and displays the emoji + + +lessons = [] +while True: + + fundamentals = input(emoji.demojize(f'Fundamentals enter an emoji code: \n✅\nor\n❌ ')) + exceptions = input(emoji.demojize(f'Exceptions + Testing enter an emoji code: \n✅\nor\n❌ ')) + + # demojize takes the emoji and displays the code for it + + lessons.append ({ + 'Fundamentals': fundamentals + }) + + print(emoji.emojize(str(lessons))) + + # if fundamentals == (':check_mark_button:'): + # lessons.append ({ + # 'Fundamentals': fundamentals + # }) + # else if fundamentals == (':cross_mark:') + # lessons.append ({ + # 'Fundamentals': fundamentals + # }) + + # exceptions = input(emoji.demojize(f'Exceptions + Testing enter ✅ if reviewed: ')) + # if exceptions == (':check_mark_button:'): + # lessons.append ({ + # 'Exceptions + Testing': exceptions + # }) + # else: + # print('Please review Exceptions + Testing') + + # print(emoji.emojize(str(lessons))) + + + # Fundamentals\nExceptions + Testing\nNumbers + Arithmetic\nBooleans + Comparisons + Conditionals\nImports + Modules + Packages\nRandom\nWhile + For Loops\nStrings\nLists + Tuples\nFunctions\nDictionaries\nRegular Expressions in Python\nDatetimes\nClasses\nRequests\nDocstrings\nFile IO\nSets\nVirtual Environments\n\nEnter a lesson to see my description: ') + + # if lesson == 'Fundamentals': + # print(emoji.emojize(f'Fundamentals :school: is about different data types from strings :COOL_button: to integers :input_numbers: and also goes over dictionaries and lists.')) + # elif lesson == 'Exceptions': + # print(emoji.emojize(f'Exceptions and Testing :test_tube: is about Python finding errors in your code and giving you a message :spiral_notepad:" including the line :pencil:" the error occured on.')) + # elif lesson == 'Numbers': + # print(emoji.emojize(f'Numbers and Arithmetic :input_numbers: in Python is about different types of numbers from Integers to Floats and mathematical operations to get a result from those numbers')) + + # lessons.append ({ + # 'Fundamentals': fundamentals}) + + + +# variable = pippackage.getpipthing('parameters') + +# print(variable) \ No newline at end of file From aa68d34bf8fa15fae76c3a02a64b2db24cfee18f Mon Sep 17 00:00:00 2001 From: rayk472 <102784710+rayk472@users.noreply.github.com> Date: Wed, 27 Jul 2022 22:22:56 -0700 Subject: [PATCH 03/11] Mini capstone playing with packages --- code/kelin/labs/mini_capstone.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/code/kelin/labs/mini_capstone.py b/code/kelin/labs/mini_capstone.py index c364b97d..fa4b1965 100644 --- a/code/kelin/labs/mini_capstone.py +++ b/code/kelin/labs/mini_capstone.py @@ -1,4 +1,5 @@ import emoji +import word2emoji # https://pypi.org/project/emoji/ emoji 2.0.0 # pip install emoji @@ -33,8 +34,10 @@ lessons = [] while True: - fundamentals = input(emoji.demojize(f'Fundamentals enter an emoji code: \n✅\nor\n❌ ')) - exceptions = input(emoji.demojize(f'Exceptions + Testing enter an emoji code: \n✅\nor\n❌ ')) + fundamentals = input(f'Enter a word to describe Fundamentals: ') + fundamentals = word2emoji(fundamentals) + + # exceptions = input(emoji.demojize(f'Exceptions + Testing enter an emoji code: \n✅\nor\n❌ ')) # demojize takes the emoji and displays the code for it From 5e7d021ef3273db30e6fce18c7ba2e15376a9269 Mon Sep 17 00:00:00 2001 From: rayk472 <102784710+rayk472@users.noreply.github.com> Date: Thu, 28 Jul 2022 18:45:23 -0700 Subject: [PATCH 04/11] Working on mini cap, emoji decoder --- code/kelin/labs/mini_capstone.py | 32 ++++++++++++++++++++++++-------- 1 file changed, 24 insertions(+), 8 deletions(-) diff --git a/code/kelin/labs/mini_capstone.py b/code/kelin/labs/mini_capstone.py index fa4b1965..73bff651 100644 --- a/code/kelin/labs/mini_capstone.py +++ b/code/kelin/labs/mini_capstone.py @@ -1,4 +1,5 @@ import emoji +from regex import F import word2emoji # https://pypi.org/project/emoji/ emoji 2.0.0 @@ -26,26 +27,41 @@ # Sets # Virtual Environments -print(emoji.emojize(f'Learning Python is :downcast_face_with_sweat: sometimes, and it can even make my head :exploding_head: !!!')) +print(emoji.emojize(f'Learning Python is :downcast_face_with_sweat: sometimes, and it can even make me feel like :exploding_head: !!!')) # emojize takes the code and displays the emoji -lessons = [] +learning = [] while True: - fundamentals = input(f'Enter a word to describe Fundamentals: ') - fundamentals = word2emoji(fundamentals) + word = input(f'Enter a word to describe learning Python: ') + wordemoji = word2emoji(word) + wordtwo = input(f'Enter another word: ') + wordtwoemoji = word2emoji(wordtwo) + + # exceptions = input(emoji.demojize(f'Exceptions + Testing enter an emoji code: \n✅\nor\n❌ ')) # demojize takes the emoji and displays the code for it - lessons.append ({ - 'Fundamentals': fundamentals + learning.append ({ + 'Learning Python is' : wordemoji, + 'sometimes, and it can even make me feel like' : wordtwoemoji }) - - print(emoji.emojize(str(lessons))) + + # The user inputed word is turned into an emoji + + emojicode = emoji.demojize(wordemoji) + emojicodetwo= emoji.demojize(wordtwoemoji) + + # The emojis are turned into codes + + print(learning, 'Your emoji codes are ',emojicode, 'and ', emojicodetwo) + + + # print(emoji.demojize(wordemoji, wordtwoemoji)) # if fundamentals == (':check_mark_button:'): # lessons.append ({ From e49f6e76756d54a573758f40dfa1eb28fa1357fa Mon Sep 17 00:00:00 2001 From: rayk472 <102784710+rayk472@users.noreply.github.com> Date: Thu, 28 Jul 2022 19:16:13 -0700 Subject: [PATCH 05/11] Mini capstone almost done --- code/kelin/labs/mini_capstone.py | 84 +++++++------------------------- 1 file changed, 17 insertions(+), 67 deletions(-) diff --git a/code/kelin/labs/mini_capstone.py b/code/kelin/labs/mini_capstone.py index 73bff651..1d0c3416 100644 --- a/code/kelin/labs/mini_capstone.py +++ b/code/kelin/labs/mini_capstone.py @@ -1,33 +1,17 @@ -import emoji -from regex import F -import word2emoji - # https://pypi.org/project/emoji/ emoji 2.0.0 # pip install emoji # emoji list https://carpedm20.github.io/emoji/ +# https://pypi.org/project/word2emoji/ word2emoji 0.1.5 +# pip install word2emoji + +import emoji +import word2emoji + # Using emoji package to help describe my understanding of Python lessons: -# Fundamentals -# Exceptions + Testing -# Numbers + Arithmetic -# Booleans + Comparisons + Conditionals -# Imports + Modules + Packages -# Random -# While + For Loops -# Strings -# Lists + Tuples -# Functions -# Dictionaries -# Regular Expressions in Python -# Datetimes -# Classes -# Requests -# Docstrings -# File IO -# Sets -# Virtual Environments - -print(emoji.emojize(f'Learning Python is :downcast_face_with_sweat: sometimes, and it can even make me feel like :exploding_head: !!!')) + + +print(emoji.emojize(f'Learning Python is :downcast_face_with_sweat: sometimes it can even make me feel like :exploding_head: !!!')) # emojize takes the code and displays the emoji @@ -42,13 +26,13 @@ - # exceptions = input(emoji.demojize(f'Exceptions + Testing enter an emoji code: \n✅\nor\n❌ ')) + # word2emoji takes a word and turns it into an emoji - # demojize takes the emoji and displays the code for it + # emoji.demojize takes the emoji and displays the code for it learning.append ({ 'Learning Python is' : wordemoji, - 'sometimes, and it can even make me feel like' : wordtwoemoji + 'sometimes it can make me feel like' : wordtwoemoji }) # The user inputed word is turned into an emoji @@ -56,47 +40,13 @@ emojicode = emoji.demojize(wordemoji) emojicodetwo= emoji.demojize(wordtwoemoji) - # The emojis are turned into codes + # The emojis are turned into a message and the codes are displayed to user - print(learning, 'Your emoji codes are ',emojicode, 'and ', emojicodetwo) + learningprint = pprint.Pre(learning) + print(learningprint, 'Your emoji codes are ',emojicode, 'and ',emojicodetwo) - # print(emoji.demojize(wordemoji, wordtwoemoji)) - - # if fundamentals == (':check_mark_button:'): - # lessons.append ({ - # 'Fundamentals': fundamentals - # }) - # else if fundamentals == (':cross_mark:') - # lessons.append ({ - # 'Fundamentals': fundamentals - # }) - - # exceptions = input(emoji.demojize(f'Exceptions + Testing enter ✅ if reviewed: ')) - # if exceptions == (':check_mark_button:'): - # lessons.append ({ - # 'Exceptions + Testing': exceptions - # }) - # else: - # print('Please review Exceptions + Testing') - - # print(emoji.emojize(str(lessons))) - - - # Fundamentals\nExceptions + Testing\nNumbers + Arithmetic\nBooleans + Comparisons + Conditionals\nImports + Modules + Packages\nRandom\nWhile + For Loops\nStrings\nLists + Tuples\nFunctions\nDictionaries\nRegular Expressions in Python\nDatetimes\nClasses\nRequests\nDocstrings\nFile IO\nSets\nVirtual Environments\n\nEnter a lesson to see my description: ') - # if lesson == 'Fundamentals': - # print(emoji.emojize(f'Fundamentals :school: is about different data types from strings :COOL_button: to integers :input_numbers: and also goes over dictionaries and lists.')) - # elif lesson == 'Exceptions': - # print(emoji.emojize(f'Exceptions and Testing :test_tube: is about Python finding errors in your code and giving you a message :spiral_notepad:" including the line :pencil:" the error occured on.')) - # elif lesson == 'Numbers': - # print(emoji.emojize(f'Numbers and Arithmetic :input_numbers: in Python is about different types of numbers from Integers to Floats and mathematical operations to get a result from those numbers')) - - # lessons.append ({ - # 'Fundamentals': fundamentals}) - - - -# variable = pippackage.getpipthing('parameters') + # Add support for entering own emoji codes -# print(variable) \ No newline at end of file + \ No newline at end of file From 091eee0cd06343ea26e0b72685635d8bef02d26b Mon Sep 17 00:00:00 2001 From: rayk472 <102784710+rayk472@users.noreply.github.com> Date: Thu, 28 Jul 2022 19:36:41 -0700 Subject: [PATCH 06/11] Mini cap getting done --- code/kelin/labs/mini_capstone.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/code/kelin/labs/mini_capstone.py b/code/kelin/labs/mini_capstone.py index 1d0c3416..2ea4f872 100644 --- a/code/kelin/labs/mini_capstone.py +++ b/code/kelin/labs/mini_capstone.py @@ -46,7 +46,11 @@ print(learningprint, 'Your emoji codes are ',emojicode, 'and ',emojicodetwo) + useremoji = emoji.emojize(emojicode) + useremojitwo = emoji.emojize(emojicodetwo) + + print('Learning Python is', useremoji, 'sometimes it can me me feel like', useremojitwo) + # Add support for entering own emoji codes - \ No newline at end of file From cda4522309c13be827f6408399472b640ebaec24 Mon Sep 17 00:00:00 2001 From: rayk472 <102784710+rayk472@users.noreply.github.com> Date: Thu, 28 Jul 2022 20:08:24 -0700 Subject: [PATCH 07/11] Mini cap getting done --- code/kelin/labs/mini_capstone.py | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/code/kelin/labs/mini_capstone.py b/code/kelin/labs/mini_capstone.py index 2ea4f872..0a507a42 100644 --- a/code/kelin/labs/mini_capstone.py +++ b/code/kelin/labs/mini_capstone.py @@ -8,7 +8,7 @@ import emoji import word2emoji -# Using emoji package to help describe my understanding of Python lessons: +# using emoji list adding emoji codes to a string print(emoji.emojize(f'Learning Python is :downcast_face_with_sweat: sometimes it can even make me feel like :exploding_head: !!!')) @@ -24,11 +24,7 @@ wordtwo = input(f'Enter another word: ') wordtwoemoji = word2emoji(wordtwo) - - # word2emoji takes a word and turns it into an emoji - - # emoji.demojize takes the emoji and displays the code for it learning.append ({ 'Learning Python is' : wordemoji, @@ -36,21 +32,18 @@ }) # The user inputed word is turned into an emoji + + # emoji.demojize takes the emoji and displays the code for it emojicode = emoji.demojize(wordemoji) emojicodetwo= emoji.demojize(wordtwoemoji) # The emojis are turned into a message and the codes are displayed to user - learningprint = pprint.Pre(learning) - - print(learningprint, 'Your emoji codes are ',emojicode, 'and ',emojicodetwo) - - useremoji = emoji.emojize(emojicode) - useremojitwo = emoji.emojize(emojicodetwo) - - print('Learning Python is', useremoji, 'sometimes it can me me feel like', useremojitwo) + print(learning, 'Your emoji codes are ',emojicode, 'and ',emojicodetwo) - # Add support for entering own emoji codes + # Add support for entering own emoji codes to display + + # Add support for all emoji codes From ce90825a9297be4d0dacd5957635b14f40bede6e Mon Sep 17 00:00:00 2001 From: rayk472 <102784710+rayk472@users.noreply.github.com> Date: Thu, 28 Jul 2022 22:11:38 -0700 Subject: [PATCH 08/11] Deleted 2 files --- code/kelin/Average-numbers.py | 26 ----------- code/kelin/lab04_blackjack_advice.py | 70 ---------------------------- 2 files changed, 96 deletions(-) delete mode 100644 code/kelin/Average-numbers.py delete mode 100644 code/kelin/lab04_blackjack_advice.py diff --git a/code/kelin/Average-numbers.py b/code/kelin/Average-numbers.py deleted file mode 100644 index aebc215b..00000000 --- a/code/kelin/Average-numbers.py +++ /dev/null @@ -1,26 +0,0 @@ -# kelin-lab00-average-numbers - - - - -nums = [5, 0, 8, 3, 4, 1, 6] -x = sum(nums) -i = len(nums) -answer = (x / i) -print(answer) - -# Prints Answer 3.857142857142857 Average of 5, 0, 8, 3, 4, 1, and 6 - -# Version 2 - -user_nums = [] - -while True: - user = input("Enter numbers to average, and type 'done' to calculate: ") - if user == "done": - print((sum(user_nums)) / (len(user_nums))) - else: - user_nums.append(int(user)) - print(user_nums) - -# User enters number and displays them in a list until they type 'done' and the average is given. \ No newline at end of file diff --git a/code/kelin/lab04_blackjack_advice.py b/code/kelin/lab04_blackjack_advice.py deleted file mode 100644 index eb68c932..00000000 --- a/code/kelin/lab04_blackjack_advice.py +++ /dev/null @@ -1,70 +0,0 @@ -# Lab 4: Blackjack Advice - -# Let's write a python program to give basic blackjack playing advice during a game by asking the player for cards. -# First, ask the user for three playing cards (A, 2, 3, 4, 5, 6, 7, 8, 9, 10, J, Q, or K). -# Then, figure out the point value of each card individually. Number cards are worth their number, all face cards are worth 10. -# At this point, assume aces are worth 1. Use the following rules to determine the advice: - -deck_one = ['A','2','3','4','5','6','7','8','9','10','J','Q','K','A','2','3','4','5','6','7','8','9','10','J','Q','K','A','2','3','4','5','6','7','8','9','10','J','Q','K','A','2','3','4','5','6','7','8','9','10','J','Q','K'] -deck_two = ['A','2','3','4','5','6','7','8','9','10','J','Q','K','A','2','3','4','5','6','7','8','9','10','J','Q','K','A','2','3','4','5','6','7','8','9','10','J','Q','K','A','2','3','4','5','6','7','8','9','10','J','Q','K'] -deck_three = ['A','2','3','4','5','6','7','8','9','10','J','Q','K','A','2','3','4','5','6','7','8','9','10','J','Q','K','A','2','3','4','5','6','7','8','9','10','J','Q','K','A','2','3','4','5','6','7','8','9','10','J','Q','K'] - -import random - -random.shuffle(deck_one) -random.shuffle(deck_two) -random.shuffle(deck_three) - -first_card = random.choice(deck_one) -second_card = random.choice(deck_two) -third_card = random.choice(deck_three) - -print(f"Welcome to Blackjack.","Your cards are:",first_card,second_card,third_card) - -if first_card == 'A': - first_card = int('1') -elif first_card == 'J': - first_card = int('10') -elif first_card == 'Q': - first_card = int('10') -elif first_card == 'K': - first_card = int('10') - -if second_card == 'A': - second_card = int('1') -elif second_card == 'J': - second_card = int('10') -elif second_card == 'Q': - second_card = int('10') -elif second_card == 'K': - second_card = int('10') - -if third_card == 'A': - third_card = int('1') -elif third_card == 'J': - third_card = int('10') -elif third_card == 'Q': - third_card = int('10') -elif third_card == 'K': - third_card = int('10') - -first_card = (int(first_card)) -second_card = (int(second_card)) -third_card = (int(third_card)) - -card_totals = (first_card + second_card + third_card) - -if card_totals < 17: - print("You should hit.") -elif card_totals in range (17, 21): - print("You should stay.") -elif card_totals > 21: - print("Sorry you busted.") -elif card_totals > 20: - print("Congratulations, Blackjack!") - -# Version 2 (optional) - -# Aces can be worth 11 if they won't put the total point value of both cards over 21. Remember that you can have multiple aces in a hand. -# Try generating a list of all possible hand values by doubling the number of values in the output whenever you encounter an ace. -# For one half, add 1, for the other, add 11. This ensures if you have multiple aces that you account for the full range of possible values. From a22af124a4b9ebb57a364bc7d46485daf8fcbdc4 Mon Sep 17 00:00:00 2001 From: rayk472 <102784710+rayk472@users.noreply.github.com> Date: Thu, 28 Jul 2022 22:32:41 -0700 Subject: [PATCH 09/11] worked on mini cap --- code/kelin/labs/mini_capstone.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/code/kelin/labs/mini_capstone.py b/code/kelin/labs/mini_capstone.py index 0a507a42..3d0ba89c 100644 --- a/code/kelin/labs/mini_capstone.py +++ b/code/kelin/labs/mini_capstone.py @@ -15,14 +15,19 @@ # emojize takes the code and displays the emoji +def user_prompt_get_emoji(phrase): + word = input(phrase) + wordemoji = word2emoji(word) + return wordemoji + # deployed a function to take the user input for the emoji learning = [] while True: + wordemoji = user_prompt_get_emoji('Enter a word to describe learning Python: ') - word = input(f'Enter a word to describe learning Python: ') - wordemoji = word2emoji(word) - wordtwo = input(f'Enter another word: ') - wordtwoemoji = word2emoji(wordtwo) + # word = input(f'Enter a word to describe learning Python: ') + # wordemoji = word2emoji(word) + wordtwoemoji = user_prompt_get_emoji('Enter another word: ') # word2emoji takes a word and turns it into an emoji From f1e2db0dde5f2058fe0f617b72f69980a9e6660d Mon Sep 17 00:00:00 2001 From: rayk472 <102784710+rayk472@users.noreply.github.com> Date: Fri, 29 Jul 2022 19:31:46 -0700 Subject: [PATCH 10/11] mini capstone final presentation --- code/kelin/labs/emojicodes.csv | 1 + code/kelin/labs/mini_capstone.py | 13 +++++++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) create mode 100644 code/kelin/labs/emojicodes.csv diff --git a/code/kelin/labs/emojicodes.csv b/code/kelin/labs/emojicodes.csv new file mode 100644 index 00000000..a6f8c641 --- /dev/null +++ b/code/kelin/labs/emojicodes.csv @@ -0,0 +1 @@ +:monkey::hammer: \ No newline at end of file diff --git a/code/kelin/labs/mini_capstone.py b/code/kelin/labs/mini_capstone.py index 3d0ba89c..4ffaf0fa 100644 --- a/code/kelin/labs/mini_capstone.py +++ b/code/kelin/labs/mini_capstone.py @@ -27,6 +27,7 @@ def user_prompt_get_emoji(phrase): # word = input(f'Enter a word to describe learning Python: ') # wordemoji = word2emoji(word) + wordtwoemoji = user_prompt_get_emoji('Enter another word: ') # word2emoji takes a word and turns it into an emoji @@ -45,10 +46,18 @@ def user_prompt_get_emoji(phrase): # The emojis are turned into a message and the codes are displayed to user - print(learning, 'Your emoji codes are ',emojicode, 'and ',emojicodetwo) - + print(learning, 'The text consists of 2 emoji codes and their translations.', emojicode, 'and', emojicodetwo, emoji.emojize(emojicode), emoji.emojize(emojicodetwo)) + + with open('emojicodes.csv', 'w') as emojicodefile: + emojicodefile.write(emojicode) + emojicodefile.write(emojicodetwo) + + # write the user emoji codes to a csv file # Add support for entering own emoji codes to display # Add support for all emoji codes + + # find support for AI generated content + From cb6e768e46d22a511d07c8d36a9f907b2a818fa9 Mon Sep 17 00:00:00 2001 From: rayk472 <102784710+rayk472@users.noreply.github.com> Date: Mon, 1 Aug 2022 15:06:14 -0700 Subject: [PATCH 11/11] emojicodes csv updated --- code/kelin/labs/emojicodes.csv | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/kelin/labs/emojicodes.csv b/code/kelin/labs/emojicodes.csv index a6f8c641..2745bcfa 100644 --- a/code/kelin/labs/emojicodes.csv +++ b/code/kelin/labs/emojicodes.csv @@ -1 +1 @@ -:monkey::hammer: \ No newline at end of file +:pregnant_woman::old_man: \ No newline at end of file