TORONTO KIDS COMPUTER CLUB | PMCA Sunday 09:00 Python Homework 20.03.01.
post-template-default,single,single-post,postid-17169,single-format-standard,ajax_fade,page_not_loaded,,qode-theme-ver-7.6.2,wpb-js-composer js-comp-ver-6.10.0,vc_responsive

PMCA Sunday 09:00 Python Homework 20.03.01.

06 Mar PMCA Sunday 09:00 Python Homework 20.03.01.

Problem Description
Text messaging using a cell phone is popular among teenagers. The messages can appear peculiar because short forms and symbols are used to abbreviate messages and hence reduce typing.

For example, “LOL” means “laughing out loud” and “:-)” is called an emoticon which looks like a happy face (on its side) and it indicates chuckling. This is all quite a mystery to some adults.

Write a program that will continually input a short form and output the translation for an adult using the following translation table:
Short Form Translation

Short Form Translation
see you
I’m happy
I’m unhappy
stick out my tongue
totally awesome
Canadian Computing Competition
you’re welcome
talk to you later

Input Specifications
The user will be prompted to enter text to be translated one line at a time. When the short form “TTYL” is entered, the program ends. Users may enter text that is found in the translation table, or they may enter other words. All entered text will be symbols or upper case letters. There will be no spaces and no quotation marks.

Output Specifications
The program will output text immediately after each line of input. If the input is one of the phrases in the translation table, the output will be the translation; if the input does not appear in the table, the output will be the original word. The translation of the last short form entered “TTYL” should
be output.

Sample Session (user input is in italics)
Enter phrase> CCC
Canadian Computing Competition
Enter phrase> :-)
I’m happy
Enter phrase> SQL
Enter phrase> TTYL
talk to you later
No Comments

Sorry, the comment form is closed at this time.