Computers and Technology
Computers and Technology, 11.11.2019 19:31, help26852

We have established contact with aliens! write a script that asks for a block of text and determines whether the text is written in the "alien language" based on these rules: a) all alien words are palindromes (they are the same forward and backward, like "glolg" or "tacocat"), can be capitalized in any way (like "gfraarfg" or "vobov"), and only use alphabetical letters ("tre3ert" is not an alien word). b) alien numbers are not always palindromes, but they always start with one or more zeroes (like "0123", "0033300", or "007"), and they never use negative numbers or floating point numbers ("0123.4" or "-042" are not alien numbers). c) aliens use limited punctuation, only commas (","), periods ("."), and question marks ("? ") are allowed, and they are only ever used at the end of a word ("gog brarb, vaav? wiwiw" is in the alien language, but "obo , drard ? mam" is not).if all the parts of the text are either alien words or alien numbers and have alien punctuation (ie, the text is of the alien language), then print 'true'; otherwise, print 'false'.hint: write a function (or multiple functions! ) that takes in a string and determines whether it is punctuated correctly, and then whether it is either an alien word or an alien number. sample input 1: glolg braahaarb mom hhhsample output 1: truesample input 2: jlumulj ? brrb gruurg 003323? sample output 2: falsesample input 3: i gtg, brb lol! sample output 3: falsesample input 4: fraaarf, xadmdax krunnurk 0064.sample output 4: truesample input 5: luughguul 8008 mmumm. sample output 5: falsesample input 6: 008boo 002 otto? sample output 6: false

answer
Answers: 3

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 05:00, edjiejwi
Lisa has a section of her document that she would like to include in the index. which option should lisa choose? mark index mark entry insert endnote add text
Answers: 3
image
Computers and Technology, 22.06.2019 15:10, passions3534ovf6dt
Which activity should be part of a long-term plan to positively affect yourhealth? oa. wearing regular clothing when handling toxinsob. not worrying about secondhand smokeoc. avoiding excessive exposure to sunlightod. drinking only well water
Answers: 1
image
Computers and Technology, 22.06.2019 20:00, bowmanari2154
What is used to analyze and summarize your data without graphical support
Answers: 1
image
Computers and Technology, 24.06.2019 07:30, sunny644
John recently worked on a project about various programming languages. he learned that though procedural language programs are useful, they have disadvantages too. what is a disadvantage of programs written in procedural languages? a. programs do not represent data complexity. b. programs take more time to execute. c. programs are prone to security threats. d. programs do not interface with multiple platforms.
Answers: 3
Do you know the correct answer?
We have established contact with aliens! write a script that asks for a block of text and determine...

Questions in other subjects:

Konu
Biology, 22.02.2021 07:00
Konu
Social Studies, 22.02.2021 07:00
Konu
Health, 22.02.2021 07:00
Konu
Mathematics, 22.02.2021 07:00