How can I make return boolean value not printed?

word_1 = str(input(f"Enter a string: "))
word_reversed = word_1[::-1]

def check_palindrome(input_string):
    if word_1 == word_reversed:
        return (True)
        print (f'{word_1} is a palindrome')
    elif word_1 != word_reversed:
        print(f'{word_1} is not a palindrome')  

> `Here is the output: 
Enter a string: level 
level is a palindrome 

I want to write retun true value but make it unvisible. I should run it with the return

Read more here:

Content Attribution

This content was originally published by Ümit Yaman at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: