# Hello, I'm back! (If I ever left?)

I'm also going to use a naming convention now.
[Beginner] assumes only basic knowledge in the target language.
[Intermediate] assumes average level knowledge in the target language.
[Expert] assumes, well, expert level knowledge in the target language.

# How to program (for beginners)

Sometimes you'll find yourself with something you want to do, but not know how to actually go about doing it.
(This tutorial is aimed at beginners)

So let's use the example of a program that checks if it's a palindrome.

We can break this down into a couple of steps:

• Get the user input & clean the string
• Reverse it and check if it's the same
• Output the results

## Get user input & clean the string.

We can break this down even further:

• Get user input
• Remove any non-alphanumeric chars.

So let's start our code:

``````original = input("> ")
original_clean = ''.join([c for c in original if c.isdigit() or c.isalpha)])``````

You might be confused about what means.

`''.join(list)` makes a array of chars `['f', 'o', 'o']` into a string (returns "foo")

We then use a generator to get every char in the input if it is a letter or a number (remove anything not matching)

And we now sanitized our input.

## Reverse the string & check if it's a palindrome

So now we have a clean string, so now we need to reverse it.
(To reverse a string we use `str[::-1]`)
So we can store the reversed string into a var:

``````original = input("> ")
original_clean = ''.join([c for c in original if c.isdigit() or c.isalpha)])
reversed = original_clean[::-1]``````

After this we compare to see if they are the same:

``````original = input("> ")
original_clean = ''.join([c for c in original if c.isdigit() or c.isalpha)])
reversed = original_clean[::-1]
pali = reversed == original_clean``````

## Output the results

So now we find ourselves on the last step, outputting it.

I'm just going to use a one-liner since that's the most efficent.

So now we have this:

``````original = input("> ")
original_clean = ''.join([c for c in original if c.isdigit() or c.isalpha)])
reversed = original_clean[::-1]
pali = reversed == original_clean
print(f"{original} is a palindrome}" if pali else f"{original} is not a palindrome")``````

# But what if we want to do a big program?

So I've made a 'dot file manager', and these are the steps I took:

• Make a database
- Create it in the correct format
• Create an interface to the db
- Create a class that contains functions to