Question: I've got code below for this exercise. But it is not working, there might be something missing or it is wrong. #include main(){ word =

 I've got code below for this exercise. But it is not

I've got code below for this exercise. But it is not working, there might be something missing or it is wrong.

#include

main(){

word = input("Enter a word: ")

if word == word[::-1]:

print("The word is a palindrome.")

else:

print("The word is not a palindrome.")}

Lab 08 - Exercise 2. Write a program that asks the user to input a word. The program should then check whether the user has entered a palindrome () () Palindromes are words or phrases that are spelt the same backwards as they are forward Eg. rotor, radar and level are all palindromic words

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!