DEV Community

Cover image for Python Basics, Pythons 101!
Wanjala
Wanjala

Posted on

Python Basics, Pythons 101!

What is Python?

Python is an interpreted high-level general-purpose programming language. It's design philosophy emphasizes code readability with its notable use of significant indentation.
Python is dynamically-typed and garbage-collected as it supports multiple programming paradigms, including structured, object-oriented and functional programming.
It was developed by Guido van Rossum who started working on it in 1980 as the ABC successor.

Common Features for Python

  • Easy to Code: Python is very easy to learn as compared to other languages like C, C#, JavaScript, Java, etc. It is also a developer-friendly language; this is because it has a very simple and defined syntax.
  • Open Source: A very powerful language and it is free and available for the public to use and alter as needed.
  • Portability: Python code can be shared across multiple platforms where by, if we have python code for windows and we want to run this code on other platforms such as Linux, Unix, or even Mac then we do not need to change it, we can run this code on any platform.
  • Being Integrated: Python language makes it easier to use as it can be integrated with other languages to deliver on-point solutions and with ease.
  • Huge amount of libraries: Python has a large standard library which provides a rich set of module and functions so you do not have to write your own code for every single thing. There are many libraries present in python for such as regular expressions, unit-testing, web browsers, etc.
  • Object Orientation: One of the key features of python is Object-Oriented programming. Python supports object-oriented language and concepts of classes, objects encapsulation, etc.

Applications of Python Programming Language

  • AI and Machine learning
  • Data Analytics
  • Data Visualization
  • Web development
  • Game Development
  • Fin-Technology
  • Fields of SEO's

Installation

Download the latest version of Python for your operating system here. You can also read more about setting up a python development and its environment path from this tutorial by pythontutorial.net

Writing your first code

With Python it is hard to imagine complex problems can be solved with fewer lines of code. That can boost your productivity as a programmer, you worry less.

eg. we are going to write our first program.

  • First, create a new folder where you will be saving you python files, let say FirstApp.
  • Second, Fire up your VS Code and open the new folder you created, FirstApp.
  • Third, create a new python file, let say app.py file and enter the following code and save the file:
print('Hello, World!')
Enter fullscreen mode Exit fullscreen mode

To execute our Python program;
To execute the app.py file we created above, you first launch the Command Prompt on Windows or Terminal on macOS or Linux.

Navigate to the folder containing our file, for our case FirstApp.

After that, type the following command to execute the app.py file:

Python3 app.py
Enter fullscreen mode Exit fullscreen mode

If everything is fine (Environment installed and paths clearly defined) , you’ll see the following message on the screen:

Hello, World!
Enter fullscreen mode Exit fullscreen mode

And that is it! Pretty easy right?

What did you learn from the post today?

Feel free to share with me your thoughts and any questions, I'd be glad to answer them all. Plus also, I never stop learning, so am open to new ideas from you, we grow together.

For more information about learning python basics feel free to reach out to amazing resources from Lux

See you next time on my next post!

Top comments (0)