Python Puzzlers Series - Check if String is Palindrome

preview_player
Показать описание
Today, we are going to start a new series called Python Puzzlers.

In this series we will include: data structures, algorithms, brain teasers, puzzles, and coding challenges.

We will start out with some easy to medium level challenges and eventually move to more difficult problems.

We will consider Big O time and space later, when the puzzlers get more challenging.

The purpose of these tutorials will be to:
* Help you improve your coding skills or knock off the rust.
* Help to improve your problem solving skills.
* Help you answer questions on sites like LeetCode, Codewars, HackerRank, etc.
* Help you prepare for interviews - if needed.
* And most importantly - have fun coding by solving brain teasers and puzzles.

For our first puzzler, we will create a function that checks if a given python string is a palindrome.

A palindrome is a word, phrase, or sequence that reads the same backward as forward, e.g., madam, Neven, nurses run.

This puzzler level is easy.
Рекомендации по теме
Комментарии
Автор

The replace replaces the old value with the new value - so in this tutorial we get rid of the spaces by using quotes with a space (old value) and replacing with quotes with no space (new value).
string.replace(oldvalue, newvalue, optional count) = string.replace(' ', '')

RyanNoonan
Автор

You are great teacher Thank you brother 🙏

mjacfardk
welcome to shbcf.ru