uaveiro-leci/1ano/1semestre/fp/aula05/ispalindrome.py

13 lines
186 B
Python
Raw Normal View History

2022-10-20 21:22:14 +00:00
def main():
s = input('Introduza uma string >> ')
print(ispalindrome(s))
2022-11-10 23:20:38 +00:00
2022-10-20 21:22:14 +00:00
def ispalindrome(s):
pal_s = s[::-1]
2022-11-10 23:20:38 +00:00
return pal_s == s
2022-10-20 21:22:14 +00:00
if __name__ == "__main__":
main()