Question: Question C 3 [ 1 0 marks ] Write your answer in the provided file A 2 Q 3 . py . Fill in your

Question C3[10 marks]
Write your answer in the provided file A2Q3.py. Fill in your name and student ID in the proper section.
Emojis are special icons commonly used in instant messaging apps and social media platforms. When people want to express happiness, they may choose to type in the corresponding emoji characters, such as :-) to represent a happy face. There are various types of emojis, including:
- :-) (happy)
- :-( (sad)
- :'((crying)
- ;-) (wink)
In modern times, many emojis are depicted as images. However, in this question, you will only work with text-based emojis, created using simple text. Your task is to write a Python program that converts certain ASCII characters into emojis. The program will prompt the user for input. For each character in the line of input text, do the following:
- If the character is '\( h \)' or ' H ', replace it with a happy emoji: :-)
- If the character is '\( c \)' or '\( C \)', replace it with a crying emoji: :'\((\)
- If the character is 'a' or '\( A \)', replace it with an angry emoji: *^*
- Otherwise, leave the character unchanged
These specified characters '\( h \)',' H ',' c ',' C ',' a ', and 'A' are referred to as the 'emoji letters'.
Specifically, you are required to create a Python program to accomplish the following tasks. Save your source code in a file named A2Q3.py:
1. Read a line of text from the user (the program will continue to read lines until the user enters 'bye' as input)
2. Convert the 'emoji letters' to the corresponding emojis
A sample execution session of the completed program is provided below (user inputs are indicated with text highlighted in blue color).
```
Please enter a line of text (enter 'bye' to quit the program): Hello!
:-)ello!
Please enter a line of text (enter 'bye' to quit the program): What?
W:-)*^*t?
Please enter a line of text (enter 'bye' to quit the program): This is a cat.
T:-)is is *^* :'(*^*t.
Please enter a line of text (enter 'bye' to quit the program): Oh!
0:-)!
Please enter a line of text (enter 'bye' to quit the program): bye
see you next time...
```
Important points to note:
- For this question, you are NOT ALLOWED to use dictionary data type in the program.
- For this question, you are NOT ALLOWED to use .join () in the program.
- Once you have completed your program, it is important to ensure that it functions correctly with all the sample inputs provided. You should also test your program with other inputs as well. When evaluating your program, in addition to the given examples, we will assess it using different text inputs.
Question C 3 [ 1 0 marks ] Write your answer in

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!