3 # 4) Define a function that checks if a given string is a palindrome (reads the same forwards and backward) and prints True if the given string is a palindrome and False otherwise. Your program should be case insen for a given string an easy way to get its reversed form is using this shortcut the string[::-1] 5 def is_palindrome (s): 5 # 7 8 9 0 1 s=s.lower () return ==s[::-1] 2 str_1= "level" 3 str_2= "kennedy" I 34 str_3= "madam" 35 print (is_palindrome (str_1)) 36 print (is_palindrome (str_2)) 37 print (is_palindrome (str_3)) 38 # 5) Write a Python program that generates a random number between 1 and 100 and asks the user to guess it.
3 # 4) Define a function that checks if a given string is a palindrome (reads the same forwards and backward) and prints True if the given string is a palindrome and False otherwise. Your program should be case insen for a given string an easy way to get its reversed form is using this shortcut the string[::-1] 5 def is_palindrome (s): 5 # 7 8 9 0 1 s=s.lower () return ==s[::-1] 2 str_1= "level" 3 str_2= "kennedy" I 34 str_3= "madam" 35 print (is_palindrome (str_1)) 36 print (is_palindrome (str_2)) 37 print (is_palindrome (str_3)) 38 # 5) Write a Python program that generates a random number between 1 and 100 and asks the user to guess it.
Related questions
Question
100%
Something is wrong with this code. I get back “true false true” and idk why
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 4 steps with 2 images