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:
        return(False)
        print(f'{word_1} is not a palindrome')  
        
print(check_palindrome(word_1))

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

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



Read more here: https://stackoverflow.com/questions/64903003/how-can-i-make-return-boolean-value-not-printed

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: