1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Vinil7 [7]
2 years ago
9

Write a program palindrome.py that prompts for a sequence of words or numbers on a single line and checks if the entries are pal

indromes or not. A word or a number is a palindrome if it remains unchanged when reversed. e.g. rotor is a palindrome; but python is not a palindrome. e.g. 737 is a palindrome; but 110 is not a palindrome. The program receives the sequence as input and returns True if an entry is a palindrome or False if an entry is not a palindrome. Print the boolean value on one line. Print the palindromes count on the next line.
Computers and Technology
1 answer:
olya-2409 [2.1K]2 years ago
3 0

Answer:

Explanation:

The program first asks the user for the sequence of words. Then it splits the sequence into an array of words. Then it loops through the array checking each word to see if it is a palindrome. If it is it prints the word, the boolean value, and adds 1 to the palindrome_count variable. Otherwise it prints the word, false, and moves on to the next word in the list. Finally, it prints out the total value of palindrome_count.

word = input("Enter sequence of words: ")

word_list = word.split(' ')

print(word_list)

palindrome_count = 0

for word in word_list:

   print('\n\n')

   reverse = word[::-1]

   if word == reverse:

       print(word, end='\n')

       print(True, end="\n")

       palindrome_count += 1

   else:

       print(word, end='\n')

       print(False, end='\n')

print("\n\nNumber of Palindromes in Sequence: " + str(palindrome_count))

You might be interested in
Give two differences between ergonomic keyboard and standard keyboard?​
galina1969 [7]

Answer:

The biggest difference between enhanced keyboards is the 12 function keys running across the top of the keyboard, instead of 10 that run down the left side. Other changes include the addition of extra Ctrl, keys, Alt keys, and cursor arrow keys between the letter keys and numeric keypad on the right side.

Explanation:

5 0
2 years ago
Hiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii
Marianna [84]

Answer:

hello

Explanation:

how are you?

7 0
3 years ago
How do ""night modes"" on computer screens help people fall asleep?
aleksklad [387]

Answer:

it doesn't really help people fall asleep but

Explanation:

When it gets dark, your pineal gland secretes the hormone melatonin, which tells your body to get tired and go to sleep.

5 0
2 years ago
Read 2 more answers
Consumers must learn how to separate the truth from __ techniques
dmitriy555 [2]

Consumers must learn how to separate the truth from deceptive techniques.

Explanation:

Deceptive advertisements are hazardous for both consumer and advertiser. It is a misrepresentation of the nature of products or services promoted falsely by advertisers.

Professionals exploit consumers by following means:

  • false or incomplete information,
  • fraudulent activities
  • deceptive practices.

It may involve -

  • financial theft,
  • health risks,
  • scams, etc.  

Having proper knowledge about such practices and taking legal actions against fraudsters can help claim for the damages incurred.

3 0
3 years ago
Browsers often store the cookies in individual files, each named for the server that owns the cookie. Whenever the browser visit
Anna11 [10]

Answer:

The answer is TRUE.

Explanation:

Cookies in browsers are like identification criteria. It contains unique data to a specific user. The use of this is to ensure that servers or websites that you have visited previously will recognize you as the same user who has been there before. This will cause the data and website information to load faster that before.  

Think of it as your school's gate. The security guard is the browser. He will let you inside the campus without question since he has seen your school ID or has recognize you as a student of the school.  

Cookies come in various types such as:

  • Authentication cookies - most common type of cookies that websites used to recognize you as the user who has been there or logged in before.
  • Persistent cookies - cookies that can be used for long term. Sometimes, you will encounter websites that allows the user to remember his log in credentials, this is the type of cookies that these websites used. Often, these cookies are willingly enabled by users.
  • Session cookies - cookies with expiration or being stored temporarily. These cookies will be terminated once the browser is closed.
  • Third-party cookies - These are additional cookies being added by the website you are using. But these cookies are not owned by the website itself, but is being used by other websites to track down your activities to make you see and experience advertisements that are catered to you. These are mostly exposing threats.
8 0
3 years ago
Read 2 more answers
Other questions:
  • The mathematical order of operations is used in Excel when formulas are evaluated. This order of operations states the order to
    9·2 answers
  • Solve the following quadratic equation <br><br>y=6x^2-12x+1
    9·1 answer
  • In the MARS Marketing Management Simulation, the results of your marketing mix decisions:
    9·1 answer
  • A standard for compressing music into computer files that can be easily exchanged on the Internet is called a(n) ______. A. musi
    5·1 answer
  • 7. What information appears on the vertical axis?
    7·1 answer
  • Who found the first computer bug in 1947, and invented the concept of a compiler in 1952
    6·1 answer
  • Omo help me i need it now.
    12·1 answer
  • Cho 3 lớp như hình, viếtchương trình thực hiện các chức năng sau:
    15·1 answer
  • Expectation on Information Technology Fundamental​
    12·1 answer
  • Mention and discuss specific professional ethics related to augmented reality, artificial intelligence, and the internet of thin
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!