The word “Python” might sound technical and complicated at first and many beginners assume that it will be difficult.I actually almost fell for that trap.Python was actually designed to be beginner-friendly.In fact,Python is widely considered one of the easiest programming languages because of its readable syntax.
What is Python
Python is a high-level programming language used in data analytics,web development,automation,AI and so many more fields.
It was created by Guido van Rossum and released in 1991.It was named after the British comedy show 'Monty Python's Flying Circus',not after the snake.He explained that he wanted something short,unique and slightly mysterious
Instillation
I will be giving steps in setting up a jupyter notebook.
Anaconda is an open source distribution of Python and R products so within anaconda is our jupyter notebook as well as a lot of other things but our point of interest is the jupyter notebook.
step 1
You will go to your browser and search'anaconda.com'(https://www.anaconda.com/) and hit the download option.You will select your device either windows,MacBook or linux.
step 2
Once the file is downloaded read the terms and conditions and any necessary information that pops up.
step 3
Select the instillation type either just for me(recommended) or all users(requires admin privileges)
It will then show you where its being installed in in your computer as an actual file path.
step 4
Click the windows key on your keyboard and you will see the anaconda navigator(app).You will then see all the distribution and R where are stored like the visual studio code,spyder,Rstudio and the jupyter notebook.
step 5
Since we want the jupyter notebook,click the launch button jupyter notebook.You'll be using that to save folders and organize your notebooks if you have previous projects.
step 6
Click the 'New'button,that will open up python 3 kernel.That is where you'll be writing all your codes.
Writing your first code
Almost every programmer starts with a simple program called 'hello world'.It's actualy a culture by now.You can use either single or double quotes.

The 'print'command displays the output of your code.You can write anything and use the command to display it as below
Types of data in Python
Different type of information is stored differently in python
1.string(str)
This stores words,characters or sentences.It is displayed using double or single quotes at the beginning and the end of that string.
2.Integer(int)
These are numbers.You don't use any quotes while defining an integer.These are also numbers without any decimal points.
3.Float
These are integers but with a decimal point.You don't use any quotes again in defining a float
4.Boolean
This is used to define either true or false.Commonly used in conditions.
5.List([])
A list stores more than one item in one variable.It is defined using the square brackets []
6.Dictionary({})
This is used to store information using keys and values.All keys and values that are strings should have quotes before and after.Only the integers dont use quotes.When you want to highlight the keys just write 'dictionary.keys()' and values 'dictiorary.values()
NOTE:A list[],you have privileges like you can add items,remove items and change items within the list. This privilege is limited in tuples().However,Tuples are quite faster and uses less memory than lists.
The PEP 8 rules in Python
PEP 8 rules are crucial in Python because they promote readable, consistent code that multiple developers can easily understand, reducing bugs and speeding up maintenance.Following PEP 8 rules makes your code professional.
1.Use 4 spaces to keep code clean and readable.
2.Keep lines under 79 characters for easier reading and better structure.
3.Leave 2 blank lines between functions and classes for clear separation.
4.Place imports at the top of the file and group them logically
5.Use snake_case for variables/functions and CamelCase for classes to stay consistent.
6.Add spaces around operators and after commas for readability and cleaner code style.(a = b + c)
7.Write comments with #
8.Use triple quotes ' ' ' to describe what functions,classes, or modules.
conclusion
Throughout this guide,we explored the basics of Python including data types,lists,tuples and PEP 8 rules.Python’s simple and readable syntax makes learning programming much easier for beginners.
Python is actually easier than I thought when I first started learning it.With regular practice,anyone can slowly build confidence and improve their programming skills.







Top comments (0)