FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
basic-programs/python/palindrome.py at master · ProjectRipo/basic-programs · GitHub
ProjectRipo
/
basic-programs
Public
forked from
utkarsh-shekhar/basic-programs
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
basic-programs
/
python
/
palindrome.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
15 lines (14 loc) · 524 Bytes
Breadcrumbs
basic-programs
/
python
/
palindrome.py
Copy path
File metadata and controls
15 lines (14 loc) · 524 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
def
is_palindrome
(
word
):
elements
=
list
(
word
)
is_palindrome
=
True
while
len
(
elements
)
>
0
and
is_palindrome
:
if
elements
[
0
]
!=
elements
[
-
1
]:
is_palindrome
=
False
else
:
elements
.
pop
(
0
)
if
len
(
elements
)
>
0
:
elements
.
pop
(
-
1
)
return
is_palindrome
while
True
:
target
=
input
(
"Enter a word which needs to check whether a palindrome or not:"
)
print
(
" The word '"
+
target
+
"' is a palindrome :"
+
str
(
is_palindrome
(
target
)))
Back
|
FazBrowse Home
|
New Git URL