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
Which is a feature of a search engine? stores web pages belonging to a single website displays web pages within a browser finds
faltersainse [42]
Finds web pages that matches key words
8 0
3 years ago
What is the purpose of the Revisions pane in a presentation?
lana [24]
First option


Sorry if I’m wrong
7 0
3 years ago
Read 2 more answers
Which mobile game do play most pubg or call of duty mobile ​
Katena32 [7]

Answer:

Neither game, does anyone remember Angry Birds Epic though

Explanation:

That game brings me nostalgia

6 0
3 years ago
Read 2 more answers
Give big-O estimate for the number of operations (multiplication or addition) used in the following algorithm segment (ignore co
Novay_Z [31]
<span>'m pretty sure the big O is actually O(log n) Not really a proof but anyway. If you write out the values before each iteration of the loop you get. L - iteration number L i t 1 1 0 2 1 2 3 3 6 4 9 18 5 27 54 6 81 162 So if n was 80 it would take 6 iterations You can see i is growing like 3^(L-2) So if n was 1000 1000 = 3^(L-2) log(1000) [base 3] = L - 2 log(1000) [base 3] + 2 = L 8.287709822868152 = L and if you ceil the answer you get L = 9 and just to check with the table 6 81 162 7 243 486 8 729 1458 9 2187 ... The table isn't perfect but hopefully you get the main idea.</span>
6 0
4 years ago
Which one of the following word peocessing features saves younthe most time when keying a document
stira [4]
One, please use proper English, or German (my other language) in this sentence.
Two, the answer is the little icon in the top left corner, it looks like a blue SD card. Near the File pod.
5 0
3 years ago
Other questions:
  • A receiver requires 10nW as input power. If all the system losses add up to 50dB, then how much power is required from the sourc
    15·1 answer
  • To move to the most extreme right cell containing data in your worksheet, what basic key combination can you use?
    7·1 answer
  • How old is the oldest asian
    14·2 answers
  • ________ enables advertisers to display more relevant ads based on user's search and browsing history. FIP NORA A Web bug An int
    10·1 answer
  • What takes information entered into a given system and sends it automatically to all upstream systems and processes?
    6·2 answers
  • Need help!! Write an interactive program that reads lines of input from the user and converts each line into "Pig Latin." Pig La
    9·1 answer
  • (a) [5 pts] Suppose you purchase a wireless router and connect it to your cable modem. Also suppose that your ISP dynamically as
    13·1 answer
  • Java Eclipse homework. I need help coding this
    6·1 answer
  • Explain the importance of technology in at least 100 words
    11·1 answer
  • Which statement best describes a social impact of computing on the world?
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!