Write a Python function that checks whether a passed string is palindrome or not
- برمجة
- برمجة بايثون
- 2021-04-16
- salsabeelalhams99111801528
الأجوبة
def isPalindrome(string):
left_pos = 0
right_pos = len(string) - 1
while right_pos >= left_pos:
if string[left_pos] != string[right_pos]:
return False
left_pos += 1
right_pos -= 1
return True
print(isPalindrome('aza')) أسئلة مشابهة
القوائم الدراسية التي ينتمي لها السؤال