mirror of
https://github.com/Alvin-Zilverstand/ict-algemeen-opdrachten.git
synced 2026-03-06 21:29:36 +01:00
Add calculator and weather API scripts in JavaScript and Python
This commit is contained in:
11
Python/palindroom/palindroom.py
Normal file
11
Python/palindroom/palindroom.py
Normal file
@@ -0,0 +1,11 @@
|
||||
def is_palindrome(word):
|
||||
return word == word[::-1]
|
||||
|
||||
# Vraag de gebruiker om een woord in te voeren
|
||||
input_word = input("Voer een woord in: ")
|
||||
|
||||
# Controleer of het woord een palindroom is en geef het resultaat weer
|
||||
if is_palindrome(input_word):
|
||||
print(f"{input_word} is een palindroom.")
|
||||
else:
|
||||
print(f"{input_word} is geen palindroom.")
|
||||
Reference in New Issue
Block a user