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
frozen [14]
3 years ago
12

Your task is to build a palindrome from an input string.A palindrome is a word that readsthe same backward or forward. Your code

will take the first 5 characters of the user input, and create a 9-character palindrome from it.Words shorter than 5 characters will result in a runtime error when you run your code. This is acceptablefor this exercise, however you already know how to validate user input with an IF statement.Some examplesof input words and the resulting palindromes:
Computers and Technology
1 answer:
White raven [17]3 years ago
7 0

Answer:

The program in Python is as follows:

word = input("Word: ")

if len(word) < 5:

   print("At least 5 characters")

else:

   pal = word[0:5]

   word = word[0:4]

   word = word[::-1]

   pal+=word

   print(pal)

Explanation:

This gets the word from the user

word = input("Word: ")

This checks if the length of the word is less than 5.

if len(word) < 5:

If yes, this tells the user that at least 5 characters is needed

   print("At least 5 characters")

If otherwise

else:

This extracts the first 5 characters of the word into variable named pal

   pal = word[0:5]

This extracts the first 5 characters of the word into variable named word

   word = word[0:4]

This reverses variable word

   word = word[::-1]

This concatenates pal and word

   pal+=word

This prints the generated palindrome

   print(pal)

You might be interested in
Which internet technology allows businesses to make presentations and share visual aids such as charts and graphs ?
Akimi4 [234]

Web conferencing is an internet technology that allows people in remote locations collaborate in a virtual conference room by making presentations and sharing visual aids.

Let me know if you have any questions.

8 0
4 years ago
Read 2 more answers
Thegroup of technologies concerned with the capturing, processing and transmissionof information in the digital electronic form
lorasvet [3.4K]

Answer: Telecom engineering

Explanation:

As, the telecom engineering is the process of capturing, processing and transmission of information in the digital form. Basically, it is responsible for transmission of data by converting the analog signal into the digital form by using various optical fiber tools and electronic service system. It is the type electronic data exchanger by which information is transmitted by using cables or wires.

6 0
3 years ago
Which is not a proper statement?
kodGreya [7K]

Answer:

leftisBlocked()

Explanation:

4 0
3 years ago
Read 2 more answers
If I wanted to repeat an action such as a heading for a paper, it would be helpful to _____.
NemiM [27]
Possibly rephrase or rewrite the heading or whatever else you decide to repeat. You should never say the exact thing twice. 
Hope I helped :)
7 0
3 years ago
Read 2 more answers
to see additional functions available in an open desktop, document or website what action should the user perform?
Phoenix [80]

To see additional functions available in an open desktop, document or website, the action that the user should perform is; Right click the mouse

  • When working on either open desktop, document or website, we make use of the mouse button to carry out a couple of operations.

  • Now, the left mouse button is the main button of the mouse primarily used for selection of an item or word or object e.t.c. Whereas, when it comes to seeing more options or functions associated with the highlighted item of the mouse left button or just random additional functions without any selection, right clicking the mouse button would be the best action.

Read more on additional functions at; brainly.com/question/1092681

6 0
2 years ago
Read 2 more answers
Other questions:
  • Define the method object inc_num_kids() for personinfo. inc_num_kids increments the member data num_kids. sample output for the
    11·1 answer
  • A vehicle travels 2345 m in 315 toward the evening sun. What is its velocity
    13·1 answer
  • A ________ is s field or set of fields in a record that uniquely defines the record.
    7·1 answer
  • What would a good digital citizen do in the following situation? Nick sees that his classmate left her email account open on a s
    11·1 answer
  • Mike needs to write the primary objectives of a project in a project plan. In which section should he write them?
    6·1 answer
  • You are the network administrator for Slimjim, a peripheral device company. The network uses Linux, and you need information on
    10·1 answer
  • What is one advantage and disadvantage of designing a support security that might be based on a centralized model, where all sen
    11·1 answer
  • Assume a TCP sender is continuously sending 1,090-byte segments. If a TCP receiver advertises a window size of 5,718 bytes, and
    7·1 answer
  • Which situations are the most likely to use telehealth? Select 3 options.
    7·1 answer
  • Draw a flow chart to access the marks of three students. calculate the total avarage and display the result​
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!