Python MCQ Quize | CodeAj #pythoncoding4u

preview_player
Показать описание
What does the following code snippet do?

x = 'hello
print(x[::-1] == x)

A) Checks if x is a palindrome
B) Reverses x
C) Prints x in reverse
D) Checks if x is an anagram

Explaination:
The code checks if the reverse of x is equal to x, which is a way to check if x is a palindrome.

Answer
A) Checks if x is a palindrome

#codeaj #python #pythoncoding #pythoncoding4u
Рекомендации по теме
welcome to shbcf.ru