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
Alex787 [66]
3 years ago
12

Write a function check_palindrome that takes a string as an input and within that function determines whether the input string i

s a palindrome or not (a word or phrase that is read the same forward as it is backward - i.e. kayak, dad, etc.). If it is a palindrome, return 'Hey! That's a palindrome!' If it is not a palindrome, return 'Bummer. Not a palindrome.' Remember that you created a function that can reverse a string above.
Computers and Technology
1 answer:
Setler79 [48]3 years ago
3 0

Answer:

The function in Python is as follows:

def check_palindrome(strn):

   retstr = "Bummer. Not a palindrome."

   if strn[len(strn)::-1] ==strn:

       retstr = "Hey! That's a palindrome!"

       

   return retstr

Explanation:

This defines the function

def check_palindrome(strn):

This sets the return string to not a palindrome

   retstr = "Bummer. Not a palindrome."

This checks if the original string and the reversed string are the same

   if strn[len(strn)::-1] ==strn:

If yes, the return string is set to palindrome

       retstr = "Hey! That's a palindrome!"

This returns the expected string

   return retstr

<em>The function to reverse the string is not given; and the programming language. So, I solve the question without considering any function</em>

You might be interested in
Dr. Joon asks her students how to insert a table in an Excel workbook. The students record the steps a chart. Which students lis
Leona [35]

Answer:

C

Explanation:

Both Table and Format as Table can be used to create a table

4 0
4 years ago
Jason wants to set up his Wi-Fi’s security. He cannot install a central server for authentication. However, he wants to use a pr
jolli1 [7]

Answer:

Answer = a ig

wpa. ig ig ig ig

4 0
3 years ago
The question is in the photo
Anastaziya [24]

Answer:

a

the most suitable answer

8 0
3 years ago
Which of the following is the best description of the [Drive for] block?
Ede4ka [16]
The answer is C to this question
6 0
3 years ago
What is the definition of overflow in binary?
asambeis [7]
Overflow occurs when the magnitude of a number exceeds the range allowed by the size of the bit field. The sum of two identically-signed numbers may very well exceed the range of the bit field of those two numbers, and so in this case overflow is a possibility.
4 0
3 years ago
Other questions:
  • Conceptual note-taking is the act of
    15·1 answer
  • Write an application that allows a user to enter the names and birth dates of up to 10 friends. Continue to prompt the user for
    6·1 answer
  • If you have a mix of 32-bit and 64-bit versions of windows, which architectures should you add a unattended installation file fo
    7·1 answer
  • Show a single view of an object, but show it in a way that makes it look 3-D, as your eye would see it.
    10·1 answer
  • A router is a device that addresses a packet on a network to the next router along the line. Under which layer of the OSI model
    5·1 answer
  • Which cost of purchasing a franchise would you still have if you start your own business​
    12·1 answer
  • Write down a program in SNOBOL thatcalculates the factorial of 7.
    10·1 answer
  • Hiya people. I am a game developer and I need an idea for a new game. If you have any ideas, pls feel free to tell me. Best idea
    6·2 answers
  • I am making a project i have to advertise a product i picked a futureistic car
    10·1 answer
  • What is the purpose of installing updates on your computer?
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!